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

Side by Side Diff: ash/system/toast/toast_overlay.cc

Issue 2001843002: Use ink drop hover for focus states on toolbar buttons and location (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout Created 4 years, 7 months 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/bar_control_button.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/system/toast/toast_overlay.h" 5 #include "ash/system/toast/toast_overlay.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // ToastOverlayButton 109 // ToastOverlayButton
110 class ToastOverlayButton : public views::LabelButton { 110 class ToastOverlayButton : public views::LabelButton {
111 public: 111 public:
112 explicit ToastOverlayButton(views::ButtonListener* listener, 112 explicit ToastOverlayButton(views::ButtonListener* listener,
113 const base::string16& label); 113 const base::string16& label);
114 ~ToastOverlayButton() override {} 114 ~ToastOverlayButton() override {}
115 115
116 private: 116 private:
117 friend class ToastOverlay; // for ToastOverlay::ClickDismissButtonForTesting. 117 friend class ToastOverlay; // for ToastOverlay::ClickDismissButtonForTesting.
118 118
119 // Controls the visual feedback for the button state.
120 std::unique_ptr<views::InkDropDelegate> ink_drop_delegate_;
121
122 DISALLOW_COPY_AND_ASSIGN(ToastOverlayButton); 119 DISALLOW_COPY_AND_ASSIGN(ToastOverlayButton);
123 }; 120 };
124 121
125 ToastOverlayButton::ToastOverlayButton(views::ButtonListener* listener, 122 ToastOverlayButton::ToastOverlayButton(views::ButtonListener* listener,
126 const base::string16& text) 123 const base::string16& text)
127 : views::LabelButton(listener, text), 124 : views::LabelButton(listener, text) {
128 ink_drop_delegate_(new views::ButtonInkDropDelegate(this, this)) { 125 set_ink_drop_delegate(
129 set_ink_drop_delegate(ink_drop_delegate_.get()); 126 base::WrapUnique(new views::ButtonInkDropDelegate(this, this)));
130 set_has_ink_drop_action_on_click(true); 127 set_has_ink_drop_action_on_click(true);
131 set_ink_drop_base_color(SK_ColorWHITE); 128 set_ink_drop_base_color(SK_ColorWHITE);
132 129
133 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); 130 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
134 131
135 SetEnabledTextColors(kButtonTextColor); 132 SetEnabledTextColors(kButtonTextColor);
136 SetFontList(rb->GetFontList(kTextFontStyle)); 133 SetFontList(rb->GetFontList(kTextFontStyle));
137 134
138 // Treat the space below the baseline as a margin. 135 // Treat the space below the baseline as a margin.
139 int verticalSpacing = kToastVerticalSpacing - 136 int verticalSpacing = kToastVerticalSpacing -
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 290
294 views::Widget* ToastOverlay::widget_for_testing() { 291 views::Widget* ToastOverlay::widget_for_testing() {
295 return overlay_widget_.get(); 292 return overlay_widget_.get();
296 } 293 }
297 294
298 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) { 295 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) {
299 overlay_view_->button()->NotifyClick(event); 296 overlay_view_->button()->NotifyClick(event);
300 } 297 }
301 298
302 } // namespace ash 299 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/bar_control_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698