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

Unified Diff: chrome/browser/ui/views/bar_control_button.cc

Issue 1411833006: Refactoring to make adding ink drop animations easier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor ink drop animations (nits in ui/views/ Created 5 years, 1 month 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/bar_control_button.h ('k') | chrome/browser/ui/views/toolbar/app_menu_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bar_control_button.cc
diff --git a/chrome/browser/ui/views/bar_control_button.cc b/chrome/browser/ui/views/bar_control_button.cc
index e8c727c66dc22c4035a2795bba662a6849b70496..6eb966be892f383899074e4fa5e3c05ea4e0a2e5 100644
--- a/chrome/browser/ui/views/bar_control_button.cc
+++ b/chrome/browser/ui/views/bar_control_button.cc
@@ -66,8 +66,7 @@ void BarControlButton::OnNativeThemeChanged(const ui::NativeTheme* theme) {
void BarControlButton::Layout() {
ImageButton::Layout();
- ink_drop_animation_controller_->SetInkDropCenter(
- GetLocalBounds().CenterPoint());
+ ink_drop_animation_controller_->SetInkDropCenter(CalculateInkDropCenter());
}
void BarControlButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {
@@ -85,6 +84,10 @@ void BarControlButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
SetPaintToLayer(false);
}
+gfx::Point BarControlButton::CalculateInkDropCenter() const {
+ return GetLocalBounds().CenterPoint();
+}
+
bool BarControlButton::OnMousePressed(const ui::MouseEvent& event) {
if (IsTriggerableEvent(event)) {
ink_drop_animation_controller_->AnimateToState(
« no previous file with comments | « chrome/browser/ui/views/bar_control_button.h ('k') | chrome/browser/ui/views/toolbar/app_menu_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698