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 "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 image()->SetFillsBoundsOpaquely(false); | 126 image()->SetFillsBoundsOpaquely(false); |
127 views::MenuButton::AddInkDropLayer(ink_drop_layer); | 127 views::MenuButton::AddInkDropLayer(ink_drop_layer); |
128 } | 128 } |
129 | 129 |
130 void ToolbarActionView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 130 void ToolbarActionView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
131 views::MenuButton::RemoveInkDropLayer(ink_drop_layer); | 131 views::MenuButton::RemoveInkDropLayer(ink_drop_layer); |
132 image()->SetFillsBoundsOpaquely(true); | 132 image()->SetFillsBoundsOpaquely(true); |
133 image()->SetPaintToLayer(false); | 133 image()->SetPaintToLayer(false); |
134 } | 134 } |
135 | 135 |
| 136 bool ToolbarActionView::ShouldShowInkDropHover() const { |
| 137 return !delegate_->ShownInsideMenu() && |
| 138 views::MenuButton::ShouldShowInkDropHover(); |
| 139 } |
| 140 |
136 content::WebContents* ToolbarActionView::GetCurrentWebContents() const { | 141 content::WebContents* ToolbarActionView::GetCurrentWebContents() const { |
137 return delegate_->GetCurrentWebContents(); | 142 return delegate_->GetCurrentWebContents(); |
138 } | 143 } |
139 | 144 |
140 void ToolbarActionView::UpdateState() { | 145 void ToolbarActionView::UpdateState() { |
141 content::WebContents* web_contents = GetCurrentWebContents(); | 146 content::WebContents* web_contents = GetCurrentWebContents(); |
142 if (SessionTabHelper::IdForTab(web_contents) < 0) | 147 if (SessionTabHelper::IdForTab(web_contents) < 0) |
143 return; | 148 return; |
144 | 149 |
145 if (!view_controller_->IsEnabled(web_contents) && | 150 if (!view_controller_->IsEnabled(web_contents) && |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 if (menu_controller->in_nested_run()) { | 359 if (menu_controller->in_nested_run()) { |
355 // There is another menu showing. Close the outermost menu (since we are | 360 // There is another menu showing. Close the outermost menu (since we are |
356 // shown in the same menu, we don't want to close the whole thing). | 361 // shown in the same menu, we don't want to close the whole thing). |
357 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); | 362 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); |
358 return true; | 363 return true; |
359 } | 364 } |
360 } | 365 } |
361 | 366 |
362 return false; | 367 return false; |
363 } | 368 } |
OLD | NEW |