OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/bubble/tray_bubble_view.h" | 5 #include "ui/views/bubble/tray_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "cc/paint/paint_flags.h" | 10 #include "cc/paint/paint_flags.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 delegate_->OnMouseExitedView(); | 386 delegate_->OnMouseExitedView(); |
387 } | 387 } |
388 | 388 |
389 void TrayBubbleView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 389 void TrayBubbleView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
390 if (delegate_ && CanActivate()) { | 390 if (delegate_ && CanActivate()) { |
391 node_data->role = ui::AX_ROLE_WINDOW; | 391 node_data->role = ui::AX_ROLE_WINDOW; |
392 node_data->SetName(delegate_->GetAccessibleNameForBubble()); | 392 node_data->SetName(delegate_->GetAccessibleNameForBubble()); |
393 } | 393 } |
394 } | 394 } |
395 | 395 |
| 396 void TrayBubbleView::OnGestureEvent(ui::GestureEvent* event) { |
| 397 if (delegate_ && delegate_->ProcessGestureEventForBubble(event)) |
| 398 event->SetHandled(); |
| 399 else |
| 400 BubbleDialogDelegateView::OnGestureEvent(event); |
| 401 } |
| 402 |
396 void TrayBubbleView::MouseMovedOutOfHost() { | 403 void TrayBubbleView::MouseMovedOutOfHost() { |
397 // The mouse was accidentally over the bubble when it opened and the AutoClose | 404 // The mouse was accidentally over the bubble when it opened and the AutoClose |
398 // logic was not activated. Now that the user did move the mouse we tell the | 405 // logic was not activated. Now that the user did move the mouse we tell the |
399 // delegate to disable AutoClose. | 406 // delegate to disable AutoClose. |
400 delegate_->OnMouseEnteredView(); | 407 delegate_->OnMouseEnteredView(); |
401 mouse_actively_entered_ = true; | 408 mouse_actively_entered_ = true; |
402 mouse_watcher_->Stop(); | 409 mouse_watcher_->Stop(); |
403 } | 410 } |
404 | 411 |
405 bool TrayBubbleView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 412 bool TrayBubbleView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 return; | 473 return; |
467 | 474 |
468 // No need to explicitly activate the widget. View::RequestFocus will activate | 475 // No need to explicitly activate the widget. View::RequestFocus will activate |
469 // it if necessary. | 476 // it if necessary. |
470 set_can_activate(true); | 477 set_can_activate(true); |
471 | 478 |
472 view->RequestFocus(); | 479 view->RequestFocus(); |
473 } | 480 } |
474 | 481 |
475 } // namespace views | 482 } // namespace views |
OLD | NEW |