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