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

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

Issue 1390113006: Added material design mouse hover feedback support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved MouseEntered/Exit() to hover handling in to the ButtonInkDropDelegate. Created 4 years, 11 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
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_button.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_button.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 void ToolbarButton::OnMouseCaptureLost() { 138 void ToolbarButton::OnMouseCaptureLost() {
139 } 139 }
140 140
141 void ToolbarButton::OnMouseExited(const ui::MouseEvent& event) { 141 void ToolbarButton::OnMouseExited(const ui::MouseEvent& event) {
142 // Starting a drag results in a MouseExited, we need to ignore it. 142 // Starting a drag results in a MouseExited, we need to ignore it.
143 // A right click release triggers an exit event. We want to 143 // A right click release triggers an exit event. We want to
144 // remain in a PUSHED state until the drop down menu closes. 144 // remain in a PUSHED state until the drop down menu closes.
145 if (state() != STATE_DISABLED && !InDrag() && state() != STATE_PRESSED) 145 if (state() != STATE_DISABLED && !InDrag() && state() != STATE_PRESSED)
146 SetState(STATE_NORMAL); 146 SetState(STATE_NORMAL);
147 UpdateInkDropHoverState();
varkha 2016/01/22 15:45:32 Would this not be taken care by the delegate's OnM
bruthig 2016/01/25 22:39:17 Removed.
147 } 148 }
148 149
149 void ToolbarButton::OnGestureEvent(ui::GestureEvent* event) { 150 void ToolbarButton::OnGestureEvent(ui::GestureEvent* event) {
150 if (menu_showing_) { 151 if (menu_showing_) {
151 // While dropdown menu is showing the button should not handle gestures. 152 // While dropdown menu is showing the button should not handle gestures.
152 event->StopPropagation(); 153 event->StopPropagation();
153 return; 154 return;
154 } 155 }
155 156
156 LabelButton::OnGestureEvent(event); 157 LabelButton::OnGestureEvent(event);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 SetMouseHandler(nullptr); 277 SetMouseHandler(nullptr);
277 278
278 // Set the state back to normal after the drop down menu is closed. 279 // Set the state back to normal after the drop down menu is closed.
279 if (state() != STATE_DISABLED) 280 if (state() != STATE_DISABLED)
280 SetState(STATE_NORMAL); 281 SetState(STATE_NORMAL);
281 } 282 }
282 283
283 const char* ToolbarButton::GetClassName() const { 284 const char* ToolbarButton::GetClassName() const {
284 return "ToolbarButton"; 285 return "ToolbarButton";
285 } 286 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/animation/button_ink_drop_delegate.h » ('j') | ui/views/animation/ink_drop_animation_controller_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698