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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_action_view.cc

Issue 1661673004: Enables hot-tracking for overflow extension buttons in the app menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restores hot-tracking of extension buttons in app menu with MD (comments) Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/toolbar/toolbar_action_view.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_action_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 image()->SetFillsBoundsOpaquely(false); 121 image()->SetFillsBoundsOpaquely(false);
122 views::MenuButton::AddInkDropLayer(ink_drop_layer); 122 views::MenuButton::AddInkDropLayer(ink_drop_layer);
123 } 123 }
124 124
125 void ToolbarActionView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { 125 void ToolbarActionView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
126 views::MenuButton::RemoveInkDropLayer(ink_drop_layer); 126 views::MenuButton::RemoveInkDropLayer(ink_drop_layer);
127 image()->SetFillsBoundsOpaquely(true); 127 image()->SetFillsBoundsOpaquely(true);
128 image()->SetPaintToLayer(false); 128 image()->SetPaintToLayer(false);
129 } 129 }
130 130
131 bool ToolbarActionView::ShouldShowInkDropHover() const {
132 return !delegate_->ShownInsideMenu() &&
133 views::MenuButton::ShouldShowInkDropHover();
134 }
135
131 content::WebContents* ToolbarActionView::GetCurrentWebContents() const { 136 content::WebContents* ToolbarActionView::GetCurrentWebContents() const {
132 return delegate_->GetCurrentWebContents(); 137 return delegate_->GetCurrentWebContents();
133 } 138 }
134 139
135 void ToolbarActionView::UpdateState() { 140 void ToolbarActionView::UpdateState() {
136 content::WebContents* web_contents = GetCurrentWebContents(); 141 content::WebContents* web_contents = GetCurrentWebContents();
137 if (SessionTabHelper::IdForTab(web_contents) < 0) 142 if (SessionTabHelper::IdForTab(web_contents) < 0)
138 return; 143 return;
139 144
140 if (!view_controller_->IsEnabled(web_contents) && 145 if (!view_controller_->IsEnabled(web_contents) &&
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 if (menu_controller->in_nested_run()) { 336 if (menu_controller->in_nested_run()) {
332 // There is another menu showing. Close the outermost menu (since we are 337 // There is another menu showing. Close the outermost menu (since we are
333 // shown in the same menu, we don't want to close the whole thing). 338 // shown in the same menu, we don't want to close the whole thing).
334 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); 339 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST);
335 return true; 340 return true;
336 } 341 }
337 } 342 }
338 343
339 return false; 344 return false;
340 } 345 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698