OLD | NEW |
---|---|
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 void ToolbarActionView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 119 void ToolbarActionView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
120 views::MenuButton::RemoveInkDropLayer(ink_drop_layer); | 120 views::MenuButton::RemoveInkDropLayer(ink_drop_layer); |
121 image()->SetPaintToLayer(false); | 121 image()->SetPaintToLayer(false); |
122 } | 122 } |
123 | 123 |
124 SkColor ToolbarActionView::GetInkDropBaseColor() const { | 124 SkColor ToolbarActionView::GetInkDropBaseColor() const { |
125 return GetThemeProvider()->GetColor( | 125 return GetThemeProvider()->GetColor( |
126 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); | 126 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); |
127 } | 127 } |
128 | 128 |
129 bool ToolbarActionView::ShouldShowInkDropHover() const { | |
130 return !delegate_->ShownInsideMenu() && | |
Evan Stade
2016/03/01 00:00:08
This seems contrary to what you wrote on the bug:
varkha
2016/03/01 00:08:58
Yes, the immediate feedback is produced by a backg
| |
131 views::MenuButton::ShouldShowInkDropHover(); | |
132 } | |
133 | |
129 content::WebContents* ToolbarActionView::GetCurrentWebContents() const { | 134 content::WebContents* ToolbarActionView::GetCurrentWebContents() const { |
130 return delegate_->GetCurrentWebContents(); | 135 return delegate_->GetCurrentWebContents(); |
131 } | 136 } |
132 | 137 |
133 void ToolbarActionView::UpdateState() { | 138 void ToolbarActionView::UpdateState() { |
134 content::WebContents* web_contents = GetCurrentWebContents(); | 139 content::WebContents* web_contents = GetCurrentWebContents(); |
135 if (SessionTabHelper::IdForTab(web_contents) < 0) | 140 if (SessionTabHelper::IdForTab(web_contents) < 0) |
136 return; | 141 return; |
137 | 142 |
138 if (!view_controller_->IsEnabled(web_contents) && | 143 if (!view_controller_->IsEnabled(web_contents) && |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 if (menu_controller->in_nested_run()) { | 334 if (menu_controller->in_nested_run()) { |
330 // There is another menu showing. Close the outermost menu (since we are | 335 // There is another menu showing. Close the outermost menu (since we are |
331 // shown in the same menu, we don't want to close the whole thing). | 336 // shown in the same menu, we don't want to close the whole thing). |
332 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); | 337 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); |
333 return true; | 338 return true; |
334 } | 339 } |
335 } | 340 } |
336 | 341 |
337 return false; | 342 return false; |
338 } | 343 } |
OLD | NEW |