| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 (base::TimeTicks::Now() - popup_closed_time_).InMilliseconds() > | 112 (base::TimeTicks::Now() - popup_closed_time_).InMilliseconds() > |
| 113 views::kMinimumMsBetweenButtonClicks; | 113 views::kMinimumMsBetweenButtonClicks; |
| 114 } | 114 } |
| 115 | 115 |
| 116 SkColor ToolbarActionView::GetInkDropBaseColor() const { | 116 SkColor ToolbarActionView::GetInkDropBaseColor() const { |
| 117 if (delegate_->ShownInsideMenu()) { | 117 if (delegate_->ShownInsideMenu()) { |
| 118 return GetNativeTheme()->GetSystemColor( | 118 return GetNativeTheme()->GetSystemColor( |
| 119 ui::NativeTheme::kColorId_HoverMenuItemBackgroundColor); | 119 ui::NativeTheme::kColorId_HoverMenuItemBackgroundColor); |
| 120 } | 120 } |
| 121 | 121 |
| 122 return GetThemeProvider() | 122 return GetThemeProvider()->GetColor( |
| 123 ? GetThemeProvider()->GetColor( | 123 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); |
| 124 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON) | |
| 125 : CustomButton::GetInkDropBaseColor(); | |
| 126 } | 124 } |
| 127 | 125 |
| 128 bool ToolbarActionView::ShouldShowInkDropHover() const { | 126 bool ToolbarActionView::ShouldShowInkDropHover() const { |
| 129 return !delegate_->ShownInsideMenu() && | 127 return !delegate_->ShownInsideMenu() && |
| 130 views::MenuButton::ShouldShowInkDropHover(); | 128 views::MenuButton::ShouldShowInkDropHover(); |
| 131 } | 129 } |
| 132 | 130 |
| 133 content::WebContents* ToolbarActionView::GetCurrentWebContents() const { | 131 content::WebContents* ToolbarActionView::GetCurrentWebContents() const { |
| 134 return delegate_->GetCurrentWebContents(); | 132 return delegate_->GetCurrentWebContents(); |
| 135 } | 133 } |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 if (menu_controller->in_nested_run()) { | 329 if (menu_controller->in_nested_run()) { |
| 332 // There is another menu showing. Close the outermost menu (since we are | 330 // 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). | 331 // shown in the same menu, we don't want to close the whole thing). |
| 334 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); | 332 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); |
| 335 return true; | 333 return true; |
| 336 } | 334 } |
| 337 } | 335 } |
| 338 | 336 |
| 339 return false; | 337 return false; |
| 340 } | 338 } |
| OLD | NEW |