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

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

Issue 1550443002: Pushed InkDropHost inheritence up to CustomButton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/toolbar_action_view.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
index 8404832d7d6d4e9ba8a9fb811cf526b7c1da60c2..0d9e6bc105f418a1512e77ebbc335e2ac1fbf64b 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -173,24 +173,6 @@ void ToolbarActionView::OnMenuButtonClicked(views::View* sender,
}
}
-void ToolbarActionView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
- SetPaintToLayer(true);
- SetFillsBoundsOpaquely(false);
- image()->SetPaintToLayer(true);
- image()->SetFillsBoundsOpaquely(false);
-
- layer()->Add(ink_drop_layer);
- layer()->StackAtBottom(ink_drop_layer);
-}
-
-void ToolbarActionView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
- layer()->Remove(ink_drop_layer);
-
- image()->SetFillsBoundsOpaquely(true);
- image()->SetPaintToLayer(false);
- SetPaintToLayer(false);
-}
-
gfx::ImageSkia ToolbarActionView::GetIconForTest() {
return GetImage(views::Button::STATE_NORMAL);
}
@@ -239,6 +221,24 @@ void ToolbarActionView::ViewHierarchyChanged(
MenuButton::ViewHierarchyChanged(details);
}
+void ToolbarActionView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
+ SetPaintToLayer(true);
+ SetFillsBoundsOpaquely(false);
+ image()->SetPaintToLayer(true);
+ image()->SetFillsBoundsOpaquely(false);
+
+ layer()->Add(ink_drop_layer);
+ layer()->StackAtBottom(ink_drop_layer);
+}
+
+void ToolbarActionView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
+ layer()->Remove(ink_drop_layer);
+
+ image()->SetFillsBoundsOpaquely(true);
+ image()->SetPaintToLayer(false);
+ SetPaintToLayer(false);
+}
+
views::View* ToolbarActionView::GetAsView() {
return this;
}
@@ -302,10 +302,6 @@ void ToolbarActionView::ShowContextMenuForView(
DoShowContextMenu(source_type);
}
-gfx::Point ToolbarActionView::CalculateInkDropCenter() const {
- return GetLocalBounds().CenterPoint();
-}
-
void ToolbarActionView::DoShowContextMenu(
ui::MenuSourceType source_type) {
ui::MenuModel* context_menu_model = view_controller_->GetContextMenu();

Powered by Google App Engine
This is Rietveld 408576698