| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 bool ToolbarActionView::IsTriggerableEvent(const ui::Event& event) { | 92 bool ToolbarActionView::IsTriggerableEvent(const ui::Event& event) { |
| 93 return views::MenuButton::IsTriggerableEvent(event) && | 93 return views::MenuButton::IsTriggerableEvent(event) && |
| 94 (base::TimeTicks::Now() - popup_closed_time_).InMilliseconds() > | 94 (base::TimeTicks::Now() - popup_closed_time_).InMilliseconds() > |
| 95 views::kMinimumMsBetweenButtonClicks; | 95 views::kMinimumMsBetweenButtonClicks; |
| 96 } | 96 } |
| 97 | 97 |
| 98 SkColor ToolbarActionView::GetInkDropBaseColor() const { | 98 SkColor ToolbarActionView::GetInkDropBaseColor() const { |
| 99 if (delegate_->ShownInsideMenu()) { | 99 if (delegate_->ShownInsideMenu()) { |
| 100 return GetNativeTheme()->GetSystemColor( | 100 return GetNativeTheme()->GetSystemColor( |
| 101 ui::NativeTheme::kColorId_HoverMenuItemBackgroundColor); | 101 ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor); |
| 102 } | 102 } |
| 103 | 103 |
| 104 return GetThemeProvider()->GetColor( | 104 return GetThemeProvider()->GetColor( |
| 105 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); | 105 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool ToolbarActionView::ShouldShowInkDropHighlight() const { | 108 bool ToolbarActionView::ShouldShowInkDropHighlight() const { |
| 109 return !delegate_->ShownInsideMenu() && | 109 return !delegate_->ShownInsideMenu() && |
| 110 views::MenuButton::ShouldShowInkDropHighlight(); | 110 views::MenuButton::ShouldShowInkDropHighlight(); |
| 111 } | 111 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 if (menu_controller->in_nested_run()) { | 308 if (menu_controller->in_nested_run()) { |
| 309 // There is another menu showing. Close the outermost menu (since we are | 309 // There is another menu showing. Close the outermost menu (since we are |
| 310 // shown in the same menu, we don't want to close the whole thing). | 310 // shown in the same menu, we don't want to close the whole thing). |
| 311 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); | 311 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); |
| 312 return true; | 312 return true; |
| 313 } | 313 } |
| 314 } | 314 } |
| 315 | 315 |
| 316 return false; | 316 return false; |
| 317 } | 317 } |
| OLD | NEW |