Chromium Code Reviews| Index: chrome/browser/ui/views/toolbar/app_menu_button.h |
| diff --git a/chrome/browser/ui/views/toolbar/app_menu_button.h b/chrome/browser/ui/views/toolbar/app_menu_button.h |
| index 78eb36fe0877bc08531b92f8b320747f8ce6e59d..7b2fc411b13f5530a51914fefe74d389f4177eb1 100644 |
| --- a/chrome/browser/ui/views/toolbar/app_menu_button.h |
| +++ b/chrome/browser/ui/views/toolbar/app_menu_button.h |
| @@ -9,6 +9,7 @@ |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" |
| #include "ui/views/controls/button/menu_button.h" |
| #include "ui/views/controls/button/menu_button_listener.h" |
| @@ -22,9 +23,10 @@ class LabelButtonBorder; |
| class MenuListener; |
| } |
| +class AppMenuAnimation; |
| class ToolbarView; |
| -class AppMenuButton : public views::MenuButton { |
| +class AppMenuButton : public views::MenuButton, public TabStripModelObserver { |
| public: |
| explicit AppMenuButton(ToolbarView* toolbar_view); |
| ~AppMenuButton() override; |
| @@ -53,9 +55,17 @@ class AppMenuButton : public views::MenuButton { |
| // views::MenuButton: |
| gfx::Size GetPreferredSize() const override; |
| + void Layout() override; |
| + void OnPaint(gfx::Canvas* canvas) override; |
| + |
| + // TabStripObserver: |
| + void TabInsertedAt(TabStripModel* tab_strip_model, |
| + content::WebContents* contents, |
| + int index, |
| + bool foreground) override; |
| // Updates the presentation according to |severity_| and the theme provider. |
| - void UpdateIcon(); |
| + void UpdateIcon(bool should_animate); |
|
msw
2017/04/11 17:34:14
nit: describe |should_animate| in the comment abov
spqchan
2017/04/12 19:42:10
Done.
|
| // Sets |margin_trailing_| when the browser is maximized and updates layout |
| // to make the focus rectangle centered. |
| @@ -96,6 +106,9 @@ class AppMenuButton : public views::MenuButton { |
| std::unique_ptr<AppMenuModel> menu_model_; |
| std::unique_ptr<AppMenu> menu_; |
| + // Used for animating and drawing the app menu icon. |
| + std::unique_ptr<AppMenuAnimation> animation_; |
| + |
| // Any trailing margin to be applied. Used when the browser is in |
| // a maximized state to extend to the full window width. |
| int margin_trailing_; |