Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Side by Side Diff: ash/common/wallpaper/wallpaper_view.cc

Issue 2775973002: Promotes more accessors from WmShell to Shell (Closed)
Patch Set: feedback Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/wallpaper/wallpaper_view.h" 5 #include "ash/common/wallpaper/wallpaper_view.h"
6 6
7 #include "ash/common/session/session_controller.h" 7 #include "ash/common/session/session_controller.h"
8 #include "ash/common/wallpaper/wallpaper_controller.h" 8 #include "ash/common/wallpaper/wallpaper_controller.h"
9 #include "ash/common/wallpaper/wallpaper_delegate.h" 9 #include "ash/common/wallpaper/wallpaper_delegate.h"
10 #include "ash/common/wallpaper/wallpaper_widget_controller.h" 10 #include "ash/common/wallpaper/wallpaper_widget_controller.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 class PreEventDispatchHandler : public ui::EventHandler { 78 class PreEventDispatchHandler : public ui::EventHandler {
79 public: 79 public:
80 PreEventDispatchHandler() {} 80 PreEventDispatchHandler() {}
81 ~PreEventDispatchHandler() override {} 81 ~PreEventDispatchHandler() override {}
82 82
83 private: 83 private:
84 // ui::EventHandler: 84 // ui::EventHandler:
85 void OnMouseEvent(ui::MouseEvent* event) override { 85 void OnMouseEvent(ui::MouseEvent* event) override {
86 CHECK_EQ(ui::EP_PRETARGET, event->phase()); 86 CHECK_EQ(ui::EP_PRETARGET, event->phase());
87 WindowSelectorController* controller = 87 WindowSelectorController* controller =
88 WmShell::Get()->window_selector_controller(); 88 Shell::Get()->window_selector_controller();
89 if (event->type() == ui::ET_MOUSE_RELEASED && controller->IsSelecting()) { 89 if (event->type() == ui::ET_MOUSE_RELEASED && controller->IsSelecting()) {
90 controller->ToggleOverview(); 90 controller->ToggleOverview();
91 event->StopPropagation(); 91 event->StopPropagation();
92 } 92 }
93 } 93 }
94 94
95 void OnGestureEvent(ui::GestureEvent* event) override { 95 void OnGestureEvent(ui::GestureEvent* event) override {
96 CHECK_EQ(ui::EP_PRETARGET, event->phase()); 96 CHECK_EQ(ui::EP_PRETARGET, event->phase());
97 WindowSelectorController* controller = 97 WindowSelectorController* controller =
98 WmShell::Get()->window_selector_controller(); 98 Shell::Get()->window_selector_controller();
99 if (event->type() == ui::ET_GESTURE_TAP && controller->IsSelecting()) { 99 if (event->type() == ui::ET_GESTURE_TAP && controller->IsSelecting()) {
100 controller->ToggleOverview(); 100 controller->ToggleOverview();
101 event->StopPropagation(); 101 event->StopPropagation();
102 } 102 }
103 } 103 }
104 104
105 DISALLOW_COPY_AND_ASSIGN(PreEventDispatchHandler); 105 DISALLOW_COPY_AND_ASSIGN(PreEventDispatchHandler);
106 }; 106 };
107 107
108 //////////////////////////////////////////////////////////////////////////////// 108 ////////////////////////////////////////////////////////////////////////////////
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // Disable animation if transition to login screen from an empty background. 233 // Disable animation if transition to login screen from an empty background.
234 wallpaper_window->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE); 234 wallpaper_window->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE);
235 } 235 }
236 236
237 WmWindow* container = root_window->GetChildByShellWindowId(container_id); 237 WmWindow* container = root_window->GetChildByShellWindowId(container_id);
238 wallpaper_widget->SetBounds(container->GetBounds()); 238 wallpaper_widget->SetBounds(container->GetBounds());
239 return wallpaper_widget; 239 return wallpaper_widget;
240 } 240 }
241 241
242 } // namespace ash 242 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/user/tray_user.cc ('k') | ash/common/wm/maximize_mode/maximize_mode_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698