| 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 BubbleDialogDelegateView::OnGestureEvent(event); |
| 399 } |
| 400 |
| 396 void TrayBubbleView::MouseMovedOutOfHost() { | 401 void TrayBubbleView::MouseMovedOutOfHost() { |
| 397 // The mouse was accidentally over the bubble when it opened and the AutoClose | 402 // 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 | 403 // logic was not activated. Now that the user did move the mouse we tell the |
| 399 // delegate to disable AutoClose. | 404 // delegate to disable AutoClose. |
| 400 delegate_->OnMouseEnteredView(); | 405 delegate_->OnMouseEnteredView(); |
| 401 mouse_actively_entered_ = true; | 406 mouse_actively_entered_ = true; |
| 402 mouse_watcher_->Stop(); | 407 mouse_watcher_->Stop(); |
| 403 } | 408 } |
| 404 | 409 |
| 405 bool TrayBubbleView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 410 bool TrayBubbleView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 return; | 471 return; |
| 467 | 472 |
| 468 // No need to explicitly activate the widget. View::RequestFocus will activate | 473 // No need to explicitly activate the widget. View::RequestFocus will activate |
| 469 // it if necessary. | 474 // it if necessary. |
| 470 set_can_activate(true); | 475 set_can_activate(true); |
| 471 | 476 |
| 472 view->RequestFocus(); | 477 view->RequestFocus(); |
| 473 } | 478 } |
| 474 | 479 |
| 475 } // namespace views | 480 } // namespace views |
| OLD | NEW |