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/focus_cycler.h" | 7 #include "ash/focus_cycler.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/session/session_controller.h" | 9 #include "ash/session/session_controller.h" |
10 #include "ash/shelf/shelf_constants.h" | 10 #include "ash/shelf/shelf_constants.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 return View::GetWidget(); | 97 return View::GetWidget(); |
98 } | 98 } |
99 | 99 |
100 const views::Widget* StatusAreaWidgetDelegate::GetWidget() const { | 100 const views::Widget* StatusAreaWidgetDelegate::GetWidget() const { |
101 return View::GetWidget(); | 101 return View::GetWidget(); |
102 } | 102 } |
103 | 103 |
104 void StatusAreaWidgetDelegate::OnGestureEvent(ui::GestureEvent* event) { | 104 void StatusAreaWidgetDelegate::OnGestureEvent(ui::GestureEvent* event) { |
105 views::Widget* target_widget = | 105 views::Widget* target_widget = |
106 static_cast<views::View*>(event->target())->GetWidget(); | 106 static_cast<views::View*>(event->target())->GetWidget(); |
107 WmWindow* target_window = WmWindow::Get(target_widget->GetNativeWindow()); | 107 WmShelf* shelf = WmShelf::ForWindow(target_widget->GetNativeWindow()); |
108 WmShelf* shelf = target_window->GetRootWindowController()->GetShelf(); | |
109 if (shelf->ProcessGestureEvent(*event)) | 108 if (shelf->ProcessGestureEvent(*event)) |
110 event->StopPropagation(); | 109 event->StopPropagation(); |
111 else | 110 else |
112 views::AccessiblePaneView::OnGestureEvent(event); | 111 views::AccessiblePaneView::OnGestureEvent(event); |
113 } | 112 } |
114 | 113 |
115 bool StatusAreaWidgetDelegate::CanActivate() const { | 114 bool StatusAreaWidgetDelegate::CanActivate() const { |
116 // We don't want mouse clicks to activate us, but we need to allow | 115 // We don't want mouse clicks to activate us, but we need to allow |
117 // activation when the user is using the keyboard (FocusCycler). | 116 // activation when the user is using the keyboard (FocusCycler). |
118 const FocusCycler* focus_cycler = focus_cycler_for_testing_ | 117 const FocusCycler* focus_cycler = focus_cycler_for_testing_ |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 child->SetBorder( | 216 child->SetBorder( |
218 views::CreateEmptyBorder(top_edge, left_edge, bottom_edge, right_edge)); | 217 views::CreateEmptyBorder(top_edge, left_edge, bottom_edge, right_edge)); |
219 | 218 |
220 // Layout on |child| needs to be updated based on new border value before | 219 // Layout on |child| needs to be updated based on new border value before |
221 // displaying; otherwise |child| will be showing with old border size. | 220 // displaying; otherwise |child| will be showing with old border size. |
222 // Fix for crbug.com/623438. | 221 // Fix for crbug.com/623438. |
223 child->Layout(); | 222 child->Layout(); |
224 } | 223 } |
225 | 224 |
226 } // namespace ash | 225 } // namespace ash |
OLD | NEW |