| 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_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 Loading... |
| 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(); |
| 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 Loading... |
| 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 } |
| OLD | NEW |