[go: nahoru, domu]

Increase AppListButton clickable area to add corner to click area

Users should be able to bring up the launcher by clicking or touching
the bottom left corner of the screen.

Make AppListButton a subclass of ViewTargeterDelegate.
Override DoesIntersectRect so that the clickable area for the button
is reverted from this change:
https://chromium-review.googlesource.com/c/chromium/src/+/1532302

Bug: 960156
Change-Id: Ifce89fef73978ce12fdc73c723ac07ae9ffeb8e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615906
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661883}
diff --git a/ash/shelf/app_list_button.h b/ash/shelf/app_list_button.h
index 86c6bfc..37bed766 100644
--- a/ash/shelf/app_list_button.h
+++ b/ash/shelf/app_list_button.h
@@ -11,6 +11,7 @@
 #include "ash/shelf/app_list_button_controller.h"
 #include "ash/shelf/shelf_control_button.h"
 #include "base/macros.h"
+#include "ui/views/view_targeter_delegate.h"
 
 namespace ash {
 
@@ -24,7 +25,8 @@
 //
 // If Assistant is enabled, the button is filled in; long-pressing it will
 // launch Assistant.
-class ASH_EXPORT AppListButton : public ShelfControlButton {
+class ASH_EXPORT AppListButton : public ShelfControlButton,
+                                 public views::ViewTargeterDelegate {
  public:
   static const char kViewClassName[];
 
@@ -47,6 +49,10 @@
   void PaintButtonContents(gfx::Canvas* canvas) override;
 
  private:
+  // views::ViewTargeterDelegate:
+  bool DoesIntersectRect(const views::View* target,
+                         const gfx::Rect& rect) const override;
+
   // The controller used to determine the button's behavior.
   AppListButtonController controller_;