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

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

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
« no previous file with comments | « chrome/browser/ui/views/toolbar/app_menu_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/app_menu_button.cc
diff --git a/chrome/browser/ui/views/toolbar/app_menu_button.cc b/chrome/browser/ui/views/toolbar/app_menu_button.cc
index 272cc0d040ab95740e921be83559b1e7ada2e5b5..3f94b5292384e231c915c069a902ce5edcd2e873 100644
--- a/chrome/browser/ui/views/toolbar/app_menu_button.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu_button.cc
@@ -18,16 +18,17 @@
#include "chrome/browser/ui/browser_otr_state.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/toolbar/app_menu_animation.h"
#include "chrome/browser/ui/toolbar/app_menu_model.h"
#include "chrome/browser/ui/views/extensions/browser_action_drag_data.h"
#include "chrome/browser/ui/views/toolbar/app_menu.h"
-#include "chrome/browser/ui/views/toolbar/app_menu_animation.h"
#include "chrome/browser/ui/views/toolbar/toolbar_button.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/theme_resources.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
+#include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/keyboard/keyboard_controller.h"
@@ -36,7 +37,9 @@
#include "ui/views/metrics.h"
namespace {
-const float kIconSize = 16;
+
+constexpr float kIconSize = 16;
+
} // namespace
// static
@@ -158,6 +161,19 @@ void AppMenuButton::TabInsertedAt(TabStripModel* tab_strip_model,
AnimateIconIfPossible();
}
+void AppMenuButton::AppMenuAnimationStarted() {
+ SetPaintToLayer();
+ layer()->SetFillsBoundsOpaquely(false);
+}
+
+void AppMenuButton::AppMenuAnimationEnded() {
+ DestroyLayer();
+}
+
+void AppMenuButton::InvalidateIcon() {
+ SchedulePaint();
+}
+
void AppMenuButton::UpdateIcon(bool should_animate) {
SkColor severity_color = gfx::kPlaceholderColor;
SkColor toolbar_icon_color =
@@ -226,15 +242,6 @@ void AppMenuButton::AnimateIconIfPossible() {
animation_->StartAnimation();
}
-void AppMenuButton::AppMenuAnimationStarted() {
- SetPaintToLayer();
- layer()->SetFillsBoundsOpaquely(false);
-}
-
-void AppMenuButton::AppMenuAnimationEnded() {
- DestroyLayer();
-}
-
const char* AppMenuButton::GetClassName() const {
return "AppMenuButton";
}
« no previous file with comments | « chrome/browser/ui/views/toolbar/app_menu_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698