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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_button.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_button.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc
index 5822bd98f6489cfbbc5b86f4562621f8bc353ae5..e00b912582527e5d861083a3bd949c05b945c246 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
@@ -173,16 +173,6 @@ ToolbarButton::CreateDefaultBorder() const {
return border.Pass();
}
-void ToolbarButton::ShowContextMenuForView(View* source,
- const gfx::Point& point,
- ui::MenuSourceType source_type) {
- if (!enabled())
- return;
-
- show_menu_factory_.InvalidateWeakPtrs();
- ShowDropDownMenu(source_type);
-}
-
void ToolbarButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {
SetPaintToLayer(true);
SetFillsBoundsOpaquely(false);
@@ -205,6 +195,16 @@ void ToolbarButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
SetPaintToLayer(false);
}
+void ToolbarButton::ShowContextMenuForView(View* source,
+ const gfx::Point& point,
+ ui::MenuSourceType source_type) {
+ if (!enabled())
+ return;
+
+ show_menu_factory_.InvalidateWeakPtrs();
+ ShowDropDownMenu(source_type);
+}
+
bool ToolbarButton::ShouldEnterPushedState(const ui::Event& event) {
// Enter PUSHED state on press with Left or Right mouse button or on taps.
// Remain in this state while the context menu is open.
@@ -301,7 +301,3 @@ void ToolbarButton::ShowDropDownMenu(ui::MenuSourceType source_type) {
const char* ToolbarButton::GetClassName() const {
return "ToolbarButton";
}
-
-gfx::Point ToolbarButton::CalculateInkDropCenter() const {
- return GetLocalBounds().CenterPoint();
-}

Powered by Google App Engine
This is Rietveld 408576698