Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_action_view.cc

Issue 2447523002: [ash-md] Added different highlighting modes to the InkDropImpl. (Closed)
Patch Set: Fixed InkDropHostView::GetInkDrop() to use CreateInkDrop(). Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/chrome_notification_types.h" 11 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/sessions/session_tab_helper.h" 12 #include "chrome/browser/sessions/session_tab_helper.h"
13 #include "chrome/browser/themes/theme_properties.h" 13 #include "chrome/browser/themes/theme_properties.h"
14 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" 14 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
15 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" 15 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
16 #include "chrome/browser/ui/view_ids.h" 16 #include "chrome/browser/ui/view_ids.h"
17 #include "content/public/browser/notification_source.h" 17 #include "content/public/browser/notification_source.h"
18 #include "ui/accessibility/ax_node_data.h" 18 #include "ui/accessibility/ax_node_data.h"
19 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
20 #include "ui/base/theme_provider.h" 20 #include "ui/base/theme_provider.h"
21 #include "ui/compositor/paint_recorder.h" 21 #include "ui/compositor/paint_recorder.h"
22 #include "ui/events/event.h" 22 #include "ui/events/event.h"
23 #include "ui/gfx/image/image_skia.h" 23 #include "ui/gfx/image/image_skia.h"
24 #include "ui/gfx/image/image_skia_operations.h" 24 #include "ui/gfx/image/image_skia_operations.h"
25 #include "ui/gfx/image/image_skia_source.h" 25 #include "ui/gfx/image/image_skia_source.h"
26 #include "ui/views/animation/ink_drop_impl.h"
26 #include "ui/views/controls/button/label_button_border.h" 27 #include "ui/views/controls/button/label_button_border.h"
27 #include "ui/views/controls/menu/menu_controller.h" 28 #include "ui/views/controls/menu/menu_controller.h"
28 #include "ui/views/controls/menu/menu_model_adapter.h" 29 #include "ui/views/controls/menu/menu_model_adapter.h"
29 #include "ui/views/controls/menu/menu_runner.h" 30 #include "ui/views/controls/menu/menu_runner.h"
30 #include "ui/views/mouse_constants.h" 31 #include "ui/views/mouse_constants.h"
31 32
32 using views::LabelButtonBorder; 33 using views::LabelButtonBorder;
33 34
34 namespace { 35 namespace {
35 36
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 SkColor ToolbarActionView::GetInkDropBaseColor() const { 99 SkColor ToolbarActionView::GetInkDropBaseColor() const {
99 if (delegate_->ShownInsideMenu()) { 100 if (delegate_->ShownInsideMenu()) {
100 return GetNativeTheme()->GetSystemColor( 101 return GetNativeTheme()->GetSystemColor(
101 ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor); 102 ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor);
102 } 103 }
103 104
104 return GetThemeProvider()->GetColor( 105 return GetThemeProvider()->GetColor(
105 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); 106 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON);
106 } 107 }
107 108
108 bool ToolbarActionView::ShouldShowInkDropHighlight() const { 109 std::unique_ptr<views::InkDrop> ToolbarActionView::CreateInkDrop() {
109 return !delegate_->ShownInsideMenu() && 110 std::unique_ptr<views::InkDropImpl> ink_drop =
110 views::MenuButton::ShouldShowInkDropHighlight(); 111 CustomButton::CreateDefaultInkDropImpl();
112 ink_drop->SetShowHighlightOnHover(!delegate_->ShownInsideMenu());
113 return std::move(ink_drop);
111 } 114 }
112 115
113 content::WebContents* ToolbarActionView::GetCurrentWebContents() const { 116 content::WebContents* ToolbarActionView::GetCurrentWebContents() const {
114 return delegate_->GetCurrentWebContents(); 117 return delegate_->GetCurrentWebContents();
115 } 118 }
116 119
117 void ToolbarActionView::UpdateState() { 120 void ToolbarActionView::UpdateState() {
118 content::WebContents* web_contents = GetCurrentWebContents(); 121 content::WebContents* web_contents = GetCurrentWebContents();
119 if (SessionTabHelper::IdForTab(web_contents) < 0) 122 if (SessionTabHelper::IdForTab(web_contents) < 0)
120 return; 123 return;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 if (menu_controller->in_nested_run()) { 311 if (menu_controller->in_nested_run()) {
309 // There is another menu showing. Close the outermost menu (since we are 312 // 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). 313 // shown in the same menu, we don't want to close the whole thing).
311 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); 314 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST);
312 return true; 315 return true;
313 } 316 }
314 } 317 }
315 318
316 return false; 319 return false;
317 } 320 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_action_view.h ('k') | ui/views/animation/flood_fill_ink_drop_ripple.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698