| 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/focus_cycler.h" | 8 #include "ash/common/focus_cycler.h" |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| 11 #include "ash/common/shelf/wm_shelf.h" | 11 #include "ash/common/shelf/wm_shelf.h" |
| 12 #include "ash/common/shelf/wm_shelf_util.h" | 12 #include "ash/common/shelf/wm_shelf_util.h" |
| 13 #include "ash/common/system/tray/tray_constants.h" | 13 #include "ash/common/system/tray/tray_constants.h" |
| 14 #include "ash/common/wm_lookup.h" | |
| 15 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
| 16 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
| 17 #include "ash/public/cpp/shell_window_ids.h" | 16 #include "ash/public/cpp/shell_window_ids.h" |
| 18 #include "ash/root_window_controller.h" | 17 #include "ash/root_window_controller.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 20 #include "ui/compositor/layer.h" | 19 #include "ui/compositor/layer.h" |
| 21 #include "ui/compositor/scoped_layer_animation_settings.h" | 20 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 22 #include "ui/gfx/animation/tween.h" | 21 #include "ui/gfx/animation/tween.h" |
| 23 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
| 24 #include "ui/gfx/image/image.h" | 23 #include "ui/gfx/image/image.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return View::GetWidget(); | 75 return View::GetWidget(); |
| 77 } | 76 } |
| 78 | 77 |
| 79 const views::Widget* StatusAreaWidgetDelegate::GetWidget() const { | 78 const views::Widget* StatusAreaWidgetDelegate::GetWidget() const { |
| 80 return View::GetWidget(); | 79 return View::GetWidget(); |
| 81 } | 80 } |
| 82 | 81 |
| 83 void StatusAreaWidgetDelegate::OnGestureEvent(ui::GestureEvent* event) { | 82 void StatusAreaWidgetDelegate::OnGestureEvent(ui::GestureEvent* event) { |
| 84 views::Widget* target_widget = | 83 views::Widget* target_widget = |
| 85 static_cast<views::View*>(event->target())->GetWidget(); | 84 static_cast<views::View*>(event->target())->GetWidget(); |
| 86 WmWindow* target_window = WmLookup::Get()->GetWindowForWidget(target_widget); | 85 WmWindow* target_window = WmWindow::Get(target_widget->GetNativeWindow()); |
| 87 WmShelf* shelf = target_window->GetRootWindowController()->GetShelf(); | 86 WmShelf* shelf = target_window->GetRootWindowController()->GetShelf(); |
| 88 if (shelf->ProcessGestureEvent(*event)) | 87 if (shelf->ProcessGestureEvent(*event)) |
| 89 event->StopPropagation(); | 88 event->StopPropagation(); |
| 90 else | 89 else |
| 91 views::AccessiblePaneView::OnGestureEvent(event); | 90 views::AccessiblePaneView::OnGestureEvent(event); |
| 92 } | 91 } |
| 93 | 92 |
| 94 bool StatusAreaWidgetDelegate::CanActivate() const { | 93 bool StatusAreaWidgetDelegate::CanActivate() const { |
| 95 // We don't want mouse clicks to activate us, but we need to allow | 94 // We don't want mouse clicks to activate us, but we need to allow |
| 96 // activation when the user is using the keyboard (FocusCycler). | 95 // activation when the user is using the keyboard (FocusCycler). |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } | 221 } |
| 223 child->SetBorder( | 222 child->SetBorder( |
| 224 views::CreateEmptyBorder(top_edge, left_edge, bottom_edge, right_edge)); | 223 views::CreateEmptyBorder(top_edge, left_edge, bottom_edge, right_edge)); |
| 225 // Layout on |child| needs to be updated based on new border value before | 224 // Layout on |child| needs to be updated based on new border value before |
| 226 // displaying; otherwise |child| will be showing with old border size. | 225 // displaying; otherwise |child| will be showing with old border size. |
| 227 // Fix for crbug.com/623438. | 226 // Fix for crbug.com/623438. |
| 228 child->Layout(); | 227 child->Layout(); |
| 229 } | 228 } |
| 230 | 229 |
| 231 } // namespace ash | 230 } // namespace ash |
| OLD | NEW |