| 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_event_filter.h" | 5 #include "ash/system/tray/tray_event_filter.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/system/tray/tray_background_view.h" | 10 #include "ash/system/tray/tray_background_view.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 return false; | 34 return false; |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool TrayEventFilter::PreHandleMouseEvent(aura::Window* target, | 37 bool TrayEventFilter::PreHandleMouseEvent(aura::Window* target, |
| 38 ui::MouseEvent* event) { | 38 ui::MouseEvent* event) { |
| 39 if (event->type() == ui::ET_MOUSE_PRESSED) | 39 if (event->type() == ui::ET_MOUSE_PRESSED) |
| 40 return ProcessLocatedEvent(target, *event); | 40 return ProcessLocatedEvent(target, *event); |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 ui::TouchStatus TrayEventFilter::PreHandleTouchEvent(aura::Window* target, | 44 ui::EventResult TrayEventFilter::PreHandleTouchEvent(aura::Window* target, |
| 45 ui::TouchEvent* event) { | 45 ui::TouchEvent* event) { |
| 46 if (event->type() == ui::ET_TOUCH_PRESSED) { | 46 if (event->type() == ui::ET_TOUCH_PRESSED) { |
| 47 if (ProcessLocatedEvent(target, *event)) | 47 if (ProcessLocatedEvent(target, *event)) |
| 48 return ui::TOUCH_STATUS_END; | 48 return ui::ER_CONSUMED; |
| 49 } | 49 } |
| 50 return ui::TOUCH_STATUS_UNKNOWN; | 50 return ui::ER_UNHANDLED; |
| 51 } | 51 } |
| 52 | 52 |
| 53 ui::EventResult TrayEventFilter::PreHandleGestureEvent( | 53 ui::EventResult TrayEventFilter::PreHandleGestureEvent( |
| 54 aura::Window* target, | 54 aura::Window* target, |
| 55 ui::GestureEvent* event) { | 55 ui::GestureEvent* event) { |
| 56 return ui::ER_UNHANDLED; | 56 return ui::ER_UNHANDLED; |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool TrayEventFilter::ProcessLocatedEvent(aura::Window* target, | 59 bool TrayEventFilter::ProcessLocatedEvent(aura::Window* target, |
| 60 const ui::LocatedEvent& event) { | 60 const ui::LocatedEvent& event) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 83 if (bounds.Contains(event.root_location())) | 83 if (bounds.Contains(event.root_location())) |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| 86 // Handle clicking outside the bubble and tray and return true if the | 86 // Handle clicking outside the bubble and tray and return true if the |
| 87 // event was handled. | 87 // event was handled. |
| 88 return wrapper_->tray()->ClickedOutsideBubble(); | 88 return wrapper_->tray()->ClickedOutsideBubble(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace internal | 91 } // namespace internal |
| 92 } // namespace ash | 92 } // namespace ash |
| OLD | NEW |