| 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 "ash/system/tray/tray_bubble_view.h" | 5 #include "ash/system/tray/tray_bubble_view.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
| 10 #include "ash/wm/shelf_layout_manager.h" | 10 #include "ash/wm/shelf_layout_manager.h" |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 ui::TouchStatus TrayBubbleView::Host::PreHandleTouchEvent( | 470 ui::TouchStatus TrayBubbleView::Host::PreHandleTouchEvent( |
| 471 aura::Window* target, | 471 aura::Window* target, |
| 472 ui::TouchEvent* event) { | 472 ui::TouchEvent* event) { |
| 473 if (event->type() == ui::ET_TOUCH_PRESSED) | 473 if (event->type() == ui::ET_TOUCH_PRESSED) |
| 474 ProcessLocatedEvent(*event); | 474 ProcessLocatedEvent(*event); |
| 475 return ui::TOUCH_STATUS_UNKNOWN; | 475 return ui::TOUCH_STATUS_UNKNOWN; |
| 476 } | 476 } |
| 477 | 477 |
| 478 ui::GestureStatus TrayBubbleView::Host::PreHandleGestureEvent( | 478 ui::GestureStatus TrayBubbleView::Host::PreHandleGestureEvent( |
| 479 aura::Window* target, | 479 aura::Window* target, |
| 480 ui::GestureEventImpl* event) { | 480 ui::GestureEvent* event) { |
| 481 return ui::GESTURE_STATUS_UNKNOWN; | 481 return ui::GESTURE_STATUS_UNKNOWN; |
| 482 } | 482 } |
| 483 | 483 |
| 484 void TrayBubbleView::Host::ProcessLocatedEvent( | 484 void TrayBubbleView::Host::ProcessLocatedEvent( |
| 485 const ui::LocatedEvent& event) { | 485 const ui::LocatedEvent& event) { |
| 486 if (!widget_) | 486 if (!widget_) |
| 487 return; | 487 return; |
| 488 gfx::Rect bounds = widget_->GetNativeWindow()->GetBoundsInRootWindow(); | 488 gfx::Rect bounds = widget_->GetNativeWindow()->GetBoundsInRootWindow(); |
| 489 if (bounds.Contains(event.root_location())) | 489 if (bounds.Contains(event.root_location())) |
| 490 return; | 490 return; |
| 491 if (tray_view_) { | 491 if (tray_view_) { |
| 492 // If the user clicks on the parent tray, don't process the event here, | 492 // If the user clicks on the parent tray, don't process the event here, |
| 493 // let the tray logic handle the event and determine show/hide behavior. | 493 // let the tray logic handle the event and determine show/hide behavior. |
| 494 bounds = tray_view_->ConvertRectToWidget(tray_view_->GetLocalBounds()); | 494 bounds = tray_view_->ConvertRectToWidget(tray_view_->GetLocalBounds()); |
| 495 if (bounds.Contains(event.location())) | 495 if (bounds.Contains(event.location())) |
| 496 return; | 496 return; |
| 497 } | 497 } |
| 498 // Handle clicking outside the bubble and tray. We don't block the event, so | 498 // Handle clicking outside the bubble and tray. We don't block the event, so |
| 499 // it will also be handled by whatever widget was clicked on. | 499 // it will also be handled by whatever widget was clicked on. |
| 500 OnClickedOutsideView(); | 500 OnClickedOutsideView(); |
| 501 } | 501 } |
| 502 | 502 |
| 503 | 503 |
| 504 } // namespace internal | 504 } // namespace internal |
| 505 } // namespace ash | 505 } // namespace ash |
| OLD | NEW |