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

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: Fixed whitespace in toolbar_action_view.h Created 4 years, 11 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/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 4bdb6dfe399ae8bb5ada56f86febf0f1ef42b617..13198fb2a94c50b90ee6b74e2670a52b60461db8 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -124,6 +124,18 @@ bool ToolbarActionView::ShouldEnterPushedState(const ui::Event& event) {
views::kMinimumMsBetweenButtonClicks;
}
+void ToolbarActionView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
+ image()->SetPaintToLayer(true);
+ image()->SetFillsBoundsOpaquely(false);
+ views::MenuButton::AddInkDropLayer(ink_drop_layer);
+}
+
+void ToolbarActionView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
+ views::MenuButton::RemoveInkDropLayer(ink_drop_layer);
+ image()->SetFillsBoundsOpaquely(true);
+ image()->SetPaintToLayer(false);
+}
+
content::WebContents* ToolbarActionView::GetCurrentWebContents() const {
return delegate_->GetCurrentWebContents();
}
@@ -173,24 +185,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);
}
@@ -302,10 +296,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