| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 ui::GestureStatus TrayBubbleView::Host::PreHandleGestureEvent( | 369 ui::GestureStatus TrayBubbleView::Host::PreHandleGestureEvent( |
| 370 aura::Window* target, | 370 aura::Window* target, |
| 371 aura::GestureEvent* event) { | 371 aura::GestureEvent* event) { |
| 372 return ui::GESTURE_STATUS_UNKNOWN; | 372 return ui::GESTURE_STATUS_UNKNOWN; |
| 373 } | 373 } |
| 374 | 374 |
| 375 void TrayBubbleView::Host::ProcessLocatedEvent( | 375 void TrayBubbleView::Host::ProcessLocatedEvent( |
| 376 const aura::LocatedEvent& event) { | 376 const aura::LocatedEvent& event) { |
| 377 if (!widget_) | 377 if (!widget_) |
| 378 return; | 378 return; |
| 379 gfx::Rect bounds = widget_->GetNativeWindow()->GetRootWindowBounds(); | 379 gfx::Rect bounds = widget_->GetNativeWindow()->GetBoundsInRootWindow(); |
| 380 if (bounds.Contains(event.root_location())) | 380 if (bounds.Contains(event.root_location())) |
| 381 return; | 381 return; |
| 382 if (tray_view_) { | 382 if (tray_view_) { |
| 383 // If the user clicks on the parent tray, don't process the event here, | 383 // If the user clicks on the parent tray, don't process the event here, |
| 384 // let the tray logic handle the event and determine show/hide behavior. | 384 // let the tray logic handle the event and determine show/hide behavior. |
| 385 bounds = tray_view_->ConvertRectToWidget(tray_view_->GetLocalBounds()); | 385 bounds = tray_view_->ConvertRectToWidget(tray_view_->GetLocalBounds()); |
| 386 if (bounds.Contains(event.location())) | 386 if (bounds.Contains(event.location())) |
| 387 return; | 387 return; |
| 388 } | 388 } |
| 389 // Handle clicking outside the bubble and tray. We don't block the event, so | 389 // Handle clicking outside the bubble and tray. We don't block the event, so |
| 390 // it will also be handled by whatever widget was clicked on. | 390 // it will also be handled by whatever widget was clicked on. |
| 391 OnClickedOutsideView(); | 391 OnClickedOutsideView(); |
| 392 } | 392 } |
| 393 | 393 |
| 394 | 394 |
| 395 } // namespace internal | 395 } // namespace internal |
| 396 } // namespace ash | 396 } // namespace ash |
| OLD | NEW |