Chromium Code Reviews| 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 "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 ToolbarActionsBar::IconHeight()); | 224 ToolbarActionsBar::IconHeight()); |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool ToolbarActionView::OnMousePressed(const ui::MouseEvent& event) { | 227 bool ToolbarActionView::OnMousePressed(const ui::MouseEvent& event) { |
| 228 // views::MenuButton actions are only triggered by left mouse clicks. | 228 // views::MenuButton actions are only triggered by left mouse clicks. |
| 229 if (event.IsOnlyLeftMouseButton()) | 229 if (event.IsOnlyLeftMouseButton()) |
| 230 ink_drop_delegate()->OnAction(views::InkDropState::ACTION_PENDING); | 230 ink_drop_delegate()->OnAction(views::InkDropState::ACTION_PENDING); |
| 231 return MenuButton::OnMousePressed(event); | 231 return MenuButton::OnMousePressed(event); |
| 232 } | 232 } |
| 233 | 233 |
| 234 void ToolbarActionView::OnMouseCaptureLost() { | |
| 235 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN); | |
|
Devlin
2015/12/10 22:18:22
Why are these in ToolbarActionView, instead of Cus
varkha
2015/12/11 02:09:43
Done.
| |
| 236 } | |
| 237 | |
| 234 void ToolbarActionView::OnGestureEvent(ui::GestureEvent* event) { | 238 void ToolbarActionView::OnGestureEvent(ui::GestureEvent* event) { |
| 235 // While the dropdown menu is showing, the button should not handle gestures. | 239 // While the dropdown menu is showing, the button should not handle gestures. |
| 236 if (menu_) | 240 if (menu_) |
| 237 event->StopPropagation(); | 241 event->StopPropagation(); |
| 238 else | 242 else |
| 239 MenuButton::OnGestureEvent(event); | 243 MenuButton::OnGestureEvent(event); |
| 240 } | 244 } |
| 241 | 245 |
| 242 void ToolbarActionView::OnDragDone() { | 246 void ToolbarActionView::OnDragDone() { |
| 243 views::MenuButton::OnDragDone(); | 247 views::MenuButton::OnDragDone(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 if (menu_controller->in_nested_run()) { | 390 if (menu_controller->in_nested_run()) { |
| 387 // There is another menu showing. Close the outermost menu (since we are | 391 // There is another menu showing. Close the outermost menu (since we are |
| 388 // shown in the same menu, we don't want to close the whole thing). | 392 // shown in the same menu, we don't want to close the whole thing). |
| 389 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); | 393 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); |
| 390 return true; | 394 return true; |
| 391 } | 395 } |
| 392 } | 396 } |
| 393 | 397 |
| 394 return false; | 398 return false; |
| 395 } | 399 } |
| OLD | NEW |