| 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/common/system/status_area_widget_delegate.h" | 5 #include "ash/common/system/status_area_widget_delegate.h" |
| 6 | 6 |
| 7 #include "ash/ash_export.h" | 7 #include "ash/ash_export.h" |
| 8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 9 #include "ash/common/focus_cycler.h" | 9 #include "ash/common/focus_cycler.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 const views::Widget* StatusAreaWidgetDelegate::GetWidget() const { | 80 const views::Widget* StatusAreaWidgetDelegate::GetWidget() const { |
| 81 return View::GetWidget(); | 81 return View::GetWidget(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void StatusAreaWidgetDelegate::OnGestureEvent(ui::GestureEvent* event) { | 84 void StatusAreaWidgetDelegate::OnGestureEvent(ui::GestureEvent* event) { |
| 85 views::Widget* target_widget = | 85 views::Widget* target_widget = |
| 86 static_cast<views::View*>(event->target())->GetWidget(); | 86 static_cast<views::View*>(event->target())->GetWidget(); |
| 87 WmWindow* target_window = WmLookup::Get()->GetWindowForWidget(target_widget); | 87 WmWindow* target_window = WmLookup::Get()->GetWindowForWidget(target_widget); |
| 88 WmShelf* shelf = target_window->GetRootWindowController()->GetShelf(); | 88 WmShelf* shelf = target_window->GetRootWindowController()->GetShelf(); |
| 89 if (shelf->ProcessGestureEvent(*event, target_window)) | 89 if (shelf->ProcessGestureEvent(*event)) |
| 90 event->StopPropagation(); | 90 event->StopPropagation(); |
| 91 else | 91 else |
| 92 views::AccessiblePaneView::OnGestureEvent(event); | 92 views::AccessiblePaneView::OnGestureEvent(event); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool StatusAreaWidgetDelegate::CanActivate() const { | 95 bool StatusAreaWidgetDelegate::CanActivate() const { |
| 96 // We don't want mouse clicks to activate us, but we need to allow | 96 // We don't want mouse clicks to activate us, but we need to allow |
| 97 // activation when the user is using the keyboard (FocusCycler). | 97 // activation when the user is using the keyboard (FocusCycler). |
| 98 const FocusCycler* focus_cycler = focus_cycler_for_testing_ | 98 const FocusCycler* focus_cycler = focus_cycler_for_testing_ |
| 99 ? focus_cycler_for_testing_ | 99 ? focus_cycler_for_testing_ |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 child->SetBorder(views::Border::CreateEmptyBorder(top_edge, left_edge, | 232 child->SetBorder(views::Border::CreateEmptyBorder(top_edge, left_edge, |
| 233 bottom_edge, right_edge)); | 233 bottom_edge, right_edge)); |
| 234 // Layout on |child| needs to be updated based on new border value before | 234 // Layout on |child| needs to be updated based on new border value before |
| 235 // displaying; otherwise |child| will be showing with old border size. | 235 // displaying; otherwise |child| will be showing with old border size. |
| 236 // Fix for crbug.com/623438. | 236 // Fix for crbug.com/623438. |
| 237 child->Layout(); | 237 child->Layout(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace ash | 240 } // namespace ash |
| OLD | NEW |