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

Side by Side Diff: ash/desktop_background/desktop_background_view.cc

Issue 2084503007: Moves WindowSelectorController onto WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_overview
Patch Set: fix mash Created 4 years, 6 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
« no previous file with comments | « ash/common/wm_shell.cc ('k') | ash/mus/bridge/wm_shell_mus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/desktop_background/desktop_background_view.h" 5 #include "ash/desktop_background/desktop_background_view.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "ash/ash_export.h" 9 #include "ash/ash_export.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/shell_window_ids.h" 11 #include "ash/common/shell_window_ids.h"
12 #include "ash/common/wm/overview/window_selector_controller.h" 12 #include "ash/common/wm/overview/window_selector_controller.h"
13 #include "ash/common/wm_shell.h"
13 #include "ash/desktop_background/desktop_background_controller.h" 14 #include "ash/desktop_background/desktop_background_controller.h"
14 #include "ash/desktop_background/desktop_background_widget_controller.h" 15 #include "ash/desktop_background/desktop_background_widget_controller.h"
15 #include "ash/desktop_background/user_wallpaper_delegate.h" 16 #include "ash/desktop_background/user_wallpaper_delegate.h"
16 #include "ash/display/display_manager.h" 17 #include "ash/display/display_manager.h"
17 #include "ash/root_window_controller.h" 18 #include "ash/root_window_controller.h"
18 #include "ash/shell.h" 19 #include "ash/shell.h"
19 #include "ash/wm/window_animations.h" 20 #include "ash/wm/window_animations.h"
20 #include "base/message_loop/message_loop.h" 21 #include "base/message_loop/message_loop.h"
21 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
22 #include "ui/aura/window_event_dispatcher.h" 23 #include "ui/aura/window_event_dispatcher.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 class PreEventDispatchHandler : public ui::EventHandler { 86 class PreEventDispatchHandler : public ui::EventHandler {
86 public: 87 public:
87 PreEventDispatchHandler() {} 88 PreEventDispatchHandler() {}
88 ~PreEventDispatchHandler() override {} 89 ~PreEventDispatchHandler() override {}
89 90
90 private: 91 private:
91 // ui::EventHandler: 92 // ui::EventHandler:
92 void OnMouseEvent(ui::MouseEvent* event) override { 93 void OnMouseEvent(ui::MouseEvent* event) override {
93 CHECK_EQ(ui::EP_PRETARGET, event->phase()); 94 CHECK_EQ(ui::EP_PRETARGET, event->phase());
94 WindowSelectorController* controller = 95 WindowSelectorController* controller =
95 Shell::GetInstance()->window_selector_controller(); 96 WmShell::Get()->window_selector_controller();
96 if (event->type() == ui::ET_MOUSE_RELEASED && controller->IsSelecting()) { 97 if (event->type() == ui::ET_MOUSE_RELEASED && controller->IsSelecting()) {
97 controller->ToggleOverview(); 98 controller->ToggleOverview();
98 event->StopPropagation(); 99 event->StopPropagation();
99 } 100 }
100 } 101 }
101 102
102 void OnGestureEvent(ui::GestureEvent* event) override { 103 void OnGestureEvent(ui::GestureEvent* event) override {
103 CHECK_EQ(ui::EP_PRETARGET, event->phase()); 104 CHECK_EQ(ui::EP_PRETARGET, event->phase());
104 WindowSelectorController* controller = 105 WindowSelectorController* controller =
105 Shell::GetInstance()->window_selector_controller(); 106 WmShell::Get()->window_selector_controller();
106 if (event->type() == ui::ET_GESTURE_TAP && controller->IsSelecting()) { 107 if (event->type() == ui::ET_GESTURE_TAP && controller->IsSelecting()) {
107 controller->ToggleOverview(); 108 controller->ToggleOverview();
108 event->StopPropagation(); 109 event->StopPropagation();
109 } 110 }
110 } 111 }
111 112
112 DISALLOW_COPY_AND_ASSIGN(PreEventDispatchHandler); 113 DISALLOW_COPY_AND_ASSIGN(PreEventDispatchHandler);
113 }; 114 };
114 115
115 //////////////////////////////////////////////////////////////////////////////// 116 ////////////////////////////////////////////////////////////////////////////////
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // Disable animation if transition to login screen from an empty background. 251 // Disable animation if transition to login screen from an empty background.
251 ::wm::SetWindowVisibilityAnimationTransition( 252 ::wm::SetWindowVisibilityAnimationTransition(
252 desktop_widget->GetNativeView(), ::wm::ANIMATE_NONE); 253 desktop_widget->GetNativeView(), ::wm::ANIMATE_NONE);
253 } 254 }
254 255
255 desktop_widget->SetBounds(params.parent->bounds()); 256 desktop_widget->SetBounds(params.parent->bounds());
256 return desktop_widget; 257 return desktop_widget;
257 } 258 }
258 259
259 } // namespace ash 260 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_shell.cc ('k') | ash/mus/bridge/wm_shell_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698