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

Side by Side Diff: ash/shelf/shelf_layout_manager.cc

Issue 2166043003: mash: Migrate ShelfLockingManager to ash/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move ShelfLockingManager test access to Shelf. Created 4 years, 5 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/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <cstring> 9 #include <cstring>
10 #include <string> 10 #include <string>
(...skipping 16 matching lines...) Expand all
27 #include "ash/root_window_controller.h" 27 #include "ash/root_window_controller.h"
28 #include "ash/screen_util.h" 28 #include "ash/screen_util.h"
29 #include "ash/shelf/shelf.h" 29 #include "ash/shelf/shelf.h"
30 #include "ash/shelf/shelf_bezel_event_filter.h" 30 #include "ash/shelf/shelf_bezel_event_filter.h"
31 #include "ash/shelf/shelf_delegate.h" 31 #include "ash/shelf/shelf_delegate.h"
32 #include "ash/shelf/shelf_layout_manager_observer.h" 32 #include "ash/shelf/shelf_layout_manager_observer.h"
33 #include "ash/shelf/shelf_util.h" 33 #include "ash/shelf/shelf_util.h"
34 #include "ash/shelf/shelf_widget.h" 34 #include "ash/shelf/shelf_widget.h"
35 #include "ash/shell.h" 35 #include "ash/shell.h"
36 #include "ash/wm/gestures/shelf_gesture_handler.h" 36 #include "ash/wm/gestures/shelf_gesture_handler.h"
37 #include "ash/wm/lock_state_controller.h"
38 #include "ash/wm/window_animations.h" 37 #include "ash/wm/window_animations.h"
39 #include "ash/wm/window_state_aura.h" 38 #include "ash/wm/window_state_aura.h"
40 #include "ash/wm/window_util.h" 39 #include "ash/wm/window_util.h"
41 #include "ash/wm/workspace_controller.h" 40 #include "ash/wm/workspace_controller.h"
42 #include "base/auto_reset.h" 41 #include "base/auto_reset.h"
43 #include "base/command_line.h" 42 #include "base/command_line.h"
44 #include "base/i18n/rtl.h" 43 #include "base/i18n/rtl.h"
45 #include "base/strings/string_number_conversions.h" 44 #include "base/strings/string_number_conversions.h"
46 #include "base/strings/string_util.h" 45 #include "base/strings/string_util.h"
47 #include "ui/aura/client/cursor_client.h" 46 #include "ui/aura/client/cursor_client.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 duration_override_in_ms_(0) { 214 duration_override_in_ms_(0) {
216 WmShell::Get()->AddShellObserver(this); 215 WmShell::Get()->AddShellObserver(this);
217 216
218 if (!Shell::GetInstance()->in_mus()) { 217 if (!Shell::GetInstance()->in_mus()) {
219 root_window_controller_observer_.reset( 218 root_window_controller_observer_.reset(
220 new RootWindowControllerObserverImpl(this)); 219 new RootWindowControllerObserverImpl(this));
221 WmWindowAura::Get(root_window_) 220 WmWindowAura::Get(root_window_)
222 ->GetRootWindowController() 221 ->GetRootWindowController()
223 ->AddObserver(root_window_controller_observer_.get()); 222 ->AddObserver(root_window_controller_observer_.get());
224 } 223 }
225 Shell::GetInstance()->lock_state_controller()->AddObserver(this); 224 WmShell::Get()->AddLockStateObserver(this);
226 aura::client::GetActivationClient(root_window_)->AddObserver(this); 225 aura::client::GetActivationClient(root_window_)->AddObserver(this);
227 WmShell::Get()->GetSessionStateDelegate()->AddSessionStateObserver(this); 226 WmShell::Get()->GetSessionStateDelegate()->AddSessionStateObserver(this);
228 } 227 }
229 228
230 ShelfLayoutManager::~ShelfLayoutManager() { 229 ShelfLayoutManager::~ShelfLayoutManager() {
231 if (update_shelf_observer_) 230 if (update_shelf_observer_)
232 update_shelf_observer_->Detach(); 231 update_shelf_observer_->Detach();
233 232
234 FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_, 233 FOR_EACH_OBSERVER(ShelfLayoutManagerObserver, observers_,
235 WillDeleteShelfLayoutManager()); 234 WillDeleteShelfLayoutManager());
236 WmShell::Get()->RemoveShellObserver(this); 235 WmShell::Get()->RemoveShellObserver(this);
237 Shell::GetInstance()->lock_state_controller()->RemoveObserver(this); 236 WmShell::Get()->RemoveLockStateObserver(this);
238 WmShell::Get()->GetSessionStateDelegate()->RemoveSessionStateObserver( 237 WmShell::Get()->GetSessionStateDelegate()->RemoveSessionStateObserver(
239 this); 238 this);
240 if (root_window_controller_observer_) { 239 if (root_window_controller_observer_) {
241 WmWindowAura::Get(root_window_) 240 WmWindowAura::Get(root_window_)
242 ->GetRootWindowController() 241 ->GetRootWindowController()
243 ->RemoveObserver(root_window_controller_observer_.get()); 242 ->RemoveObserver(root_window_controller_observer_.get());
244 } 243 }
245 } 244 }
246 245
247 void ShelfLayoutManager::PrepareForShutdown() { 246 void ShelfLayoutManager::PrepareForShutdown() {
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 if (ash::MaterialDesignController::IsShelfMaterial()) { 1206 if (ash::MaterialDesignController::IsShelfMaterial()) {
1208 return (state.visibility_state == SHELF_AUTO_HIDE && 1207 return (state.visibility_state == SHELF_AUTO_HIDE &&
1209 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN) 1208 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN)
1210 ? 1.0f 1209 ? 1.0f
1211 : 0.0f; 1210 : 0.0f;
1212 } 1211 }
1213 return (state.visibility_state == SHELF_AUTO_HIDE) ? 1.0f : 0.0f; 1212 return (state.visibility_state == SHELF_AUTO_HIDE) ? 1.0f : 0.0f;
1214 } 1213 }
1215 1214
1216 } // namespace ash 1215 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698