Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3098)

Unified Diff: chrome/browser/ui/views/toolbar/app_menu_button.h

Issue 2858313002: Refactored AppMenuAnimation (Closed)
Patch Set: Fix for msw Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 96290b40b659500fc84272b286ff4ab28b5704b1..b8fc2befaa068c6da278befeef99c5518773fea4 100644
--- a/chrome/browser/ui/views/toolbar/app_menu_button.h
+++ b/chrome/browser/ui/views/toolbar/app_menu_button.h
@@ -10,6 +10,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_animation.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"
@@ -23,10 +24,11 @@ class LabelButtonBorder;
class MenuListener;
}
-class AppMenuAnimation;
class ToolbarView;
-class AppMenuButton : public views::MenuButton, public TabStripModelObserver {
+class AppMenuButton : public views::MenuButton,
+ public TabStripModelObserver,
+ public AppMenuAnimationDelegate {
public:
explicit AppMenuButton(ToolbarView* toolbar_view);
~AppMenuButton() override;
@@ -64,6 +66,11 @@ class AppMenuButton : public views::MenuButton, public TabStripModelObserver {
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);
@@ -76,11 +83,6 @@ class AppMenuButton : public views::MenuButton, public TabStripModelObserver {
// level is none, |animation_| is nullptr or |should_use_new_icon_| is false.
void AnimateIconIfPossible();
- // Methods called by AppMenuAnimation when the animation has started/ended.
- // The layer is managed inside these methods.
- void AppMenuAnimationStarted();
- void AppMenuAnimationEnded();
-
// Opens the app menu immediately during a drag-and-drop operation.
// Used only in testing.
static bool g_open_app_immediately_for_testing;
« no previous file with comments | « chrome/browser/ui/views/toolbar/app_menu_animation.cc ('k') | chrome/browser/ui/views/toolbar/app_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698