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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |