[go: nahoru, domu]

Remove clip rect during the animation

Remove clip rect of ShelfNavitationWidget during the animation of
AssistantOverlay as it won't clip the animation.

BUG=b/184775322

Change-Id: Ic547cbb3b97ef098d9a86664fb9c1b25e868803b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2856056
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Andrew Xu <andrewxu@chromium.org>
Commit-Queue: Yuki Awano <yawano@google.com>
Cr-Commit-Position: refs/heads/master@{#890046}
diff --git a/ash/shelf/home_button.h b/ash/shelf/home_button.h
index 934f628..9ad36eb 100644
--- a/ash/shelf/home_button.h
+++ b/ash/shelf/home_button.h
@@ -13,11 +13,13 @@
 #include "ash/shelf/shelf_button_delegate.h"
 #include "ash/shelf/shelf_control_button.h"
 #include "base/macros.h"
+#include "ui/gfx/geometry/rect.h"
 #include "ui/views/view_targeter_delegate.h"
 
 namespace ash {
 
 class ShelfButtonDelegate;
+class ShelfNavigationWidget;
 
 // Button used for the AppList icon on the shelf. It opens the app list (in
 // clamshell mode) or home screen (in tablet mode). Because the clamshell-mode
@@ -30,6 +32,18 @@
                               public ShelfButtonDelegate,
                               public views::ViewTargeterDelegate {
  public:
+  class ScopedNoClipRect {
+   public:
+    explicit ScopedNoClipRect(ShelfNavigationWidget* shelf_navigation_widget);
+    ScopedNoClipRect(const ScopedNoClipRect&) = delete;
+    ScopedNoClipRect& operator=(const ScopedNoClipRect&) = delete;
+    ~ScopedNoClipRect();
+
+   private:
+    ShelfNavigationWidget* const shelf_navigation_widget_;
+    const gfx::Rect clip_rect_;
+  };
+
   static const char kViewClassName[];
 
   explicit HomeButton(Shelf* shelf);
@@ -61,6 +75,10 @@
   // Returns the display which contains this view.
   int64_t GetDisplayId() const;
 
+  // Clip rect of this view's widget will be removed during the life time of the
+  // returned ScopedNoClipRect.
+  std::unique_ptr<ScopedNoClipRect> CreateScopedNoClipRect() WARN_UNUSED_RESULT;
+
  protected:
   // views::Button:
   void PaintButtonContents(gfx::Canvas* canvas) override;