| 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 804c5f696af9525351b9bb0328abd3c34b13e127..c06fb0d920443e858cbb8a0a550f6e064ec30182 100644
|
| --- a/chrome/browser/ui/views/toolbar/app_menu_button.h
|
| +++ b/chrome/browser/ui/views/toolbar/app_menu_button.h
|
| @@ -10,8 +10,8 @@
|
| #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_animation.h"
|
| #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h"
|
| +#include "ui/views/controls/animated_icon_view.h"
|
| #include "ui/views/controls/button/menu_button.h"
|
| #include "ui/views/controls/button/menu_button_listener.h"
|
| #include "ui/views/view.h"
|
| @@ -26,9 +26,10 @@ class MenuListener;
|
|
|
| class ToolbarView;
|
|
|
| -class AppMenuButton : public views::MenuButton,
|
| - public TabStripModelObserver,
|
| - public AppMenuAnimationDelegate {
|
| +// The app menu button lives in the top right of the main browser window. It
|
| +// shows three dots and animates to a hamburger-ish icon when there's a need to
|
| +// alert the user. Clicking displays the app menu.
|
| +class AppMenuButton : public views::MenuButton, public TabStripModelObserver {
|
| public:
|
| explicit AppMenuButton(ToolbarView* toolbar_view);
|
| ~AppMenuButton() override;
|
| @@ -58,7 +59,7 @@ class AppMenuButton : public views::MenuButton,
|
| // views::MenuButton:
|
| gfx::Size CalculatePreferredSize() const override;
|
| void Layout() override;
|
| - void PaintButtonContents(gfx::Canvas* canvas) override;
|
| + void OnThemeChanged() override;
|
|
|
| // TabStripObserver:
|
| void TabInsertedAt(TabStripModel* tab_strip_model,
|
| @@ -66,11 +67,6 @@ class AppMenuButton : public views::MenuButton,
|
| int index,
|
| bool foreground) override;
|
|
|
| - // AppMenuAnimationDelegate:
|
| - void AppMenuAnimationStarted() override;
|
| - void AppMenuAnimationEnded() override;
|
| - void InvalidateIcon() override;
|
| -
|
| // Updates the presentation according to |severity_| and the theme provider.
|
| // If |should_animate| is true, the icon should animate.
|
| void UpdateIcon(bool should_animate);
|
| @@ -103,8 +99,9 @@ class AppMenuButton : public views::MenuButton,
|
| void OnDragExited() override;
|
| int OnPerformDrop(const ui::DropTargetEvent& event) override;
|
|
|
| - AppMenuIconController::Severity severity_;
|
| - AppMenuIconController::IconType type_;
|
| + AppMenuIconController::Severity severity_ =
|
| + AppMenuIconController::Severity::NONE;
|
| + AppMenuIconController::IconType type_ = AppMenuIconController::IconType::NONE;
|
|
|
| // Our owning toolbar view.
|
| ToolbarView* toolbar_view_;
|
| @@ -118,18 +115,20 @@ 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_;
|
| + // The view that depicts and animates the icon. TODO(estade): rename to
|
| + // |animated_icon_| when |should_use_new_icon_| defaults to true and is
|
| + // removed.
|
| + views::AnimatedIconView* new_icon_ = nullptr;
|
|
|
| // True if the app menu should use the new animated icon.
|
| - bool should_use_new_icon_;
|
| + bool should_use_new_icon_ = false;
|
|
|
| // 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_;
|
| + int margin_trailing_ = 0;
|
|
|
| // Used to spawn weak pointers for delayed tasks to open the overflow menu.
|
| - base::WeakPtrFactory<AppMenuButton> weak_factory_;
|
| + base::WeakPtrFactory<AppMenuButton> weak_factory_{this};
|
|
|
| DISALLOW_COPY_AND_ASSIGN(AppMenuButton);
|
| };
|
|
|