| 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/status_area_widget_delegate.h" | 5 #include "ash/system/status_area_widget_delegate.h" |
| 6 | 6 |
| 7 #include "ash/ash_export.h" | 7 #include "ash/ash_export.h" |
| 8 #include "ash/focus_cycler.h" | 8 #include "ash/focus_cycler.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 views::Widget* StatusAreaWidgetDelegate::GetWidget() { | 56 views::Widget* StatusAreaWidgetDelegate::GetWidget() { |
| 57 return View::GetWidget(); | 57 return View::GetWidget(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 const views::Widget* StatusAreaWidgetDelegate::GetWidget() const { | 60 const views::Widget* StatusAreaWidgetDelegate::GetWidget() const { |
| 61 return View::GetWidget(); | 61 return View::GetWidget(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 ui::EventResult StatusAreaWidgetDelegate::OnGestureEvent( | 64 void StatusAreaWidgetDelegate::OnGestureEvent(ui::GestureEvent* event) { |
| 65 ui::GestureEvent* event) { | |
| 66 if (gesture_handler_.ProcessGestureEvent(*event)) | 65 if (gesture_handler_.ProcessGestureEvent(*event)) |
| 67 return ui::ER_CONSUMED; | 66 event->StopPropagation(); |
| 68 | 67 else |
| 69 return views::AccessiblePaneView::OnGestureEvent(event); | 68 views::AccessiblePaneView::OnGestureEvent(event); |
| 70 } | 69 } |
| 71 | 70 |
| 72 bool StatusAreaWidgetDelegate::CanActivate() const { | 71 bool StatusAreaWidgetDelegate::CanActivate() const { |
| 73 // We don't want mouse clicks to activate us, but we need to allow | 72 // We don't want mouse clicks to activate us, but we need to allow |
| 74 // activation when the user is using the keyboard (FocusCycler). | 73 // activation when the user is using the keyboard (FocusCycler). |
| 75 const FocusCycler* focus_cycler = focus_cycler_for_testing_ ? | 74 const FocusCycler* focus_cycler = focus_cycler_for_testing_ ? |
| 76 focus_cycler_for_testing_ : Shell::GetInstance()->focus_cycler(); | 75 focus_cycler_for_testing_ : Shell::GetInstance()->focus_cycler(); |
| 77 return focus_cycler->widget_activating() == GetWidget(); | 76 return focus_cycler->widget_activating() == GetWidget(); |
| 78 } | 77 } |
| 79 | 78 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 UpdateWidgetSize(); | 124 UpdateWidgetSize(); |
| 126 } | 125 } |
| 127 | 126 |
| 128 void StatusAreaWidgetDelegate::UpdateWidgetSize() { | 127 void StatusAreaWidgetDelegate::UpdateWidgetSize() { |
| 129 if (GetWidget()) | 128 if (GetWidget()) |
| 130 GetWidget()->SetSize(GetPreferredSize()); | 129 GetWidget()->SetSize(GetPreferredSize()); |
| 131 } | 130 } |
| 132 | 131 |
| 133 } // namespace internal | 132 } // namespace internal |
| 134 } // namespace ash | 133 } // namespace ash |
| OLD | NEW |