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

Side by Side Diff: chrome/browser/chromeos/login/lock/webui_screen_locker.cc

Issue 2739763003: Moves maintaining ShellObservers back to Shell (Closed)
Patch Set: merge 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
« no previous file with comments | « ash/wm/video_detector.cc ('k') | chrome/browser/chromeos/login/ui/login_display_host_impl.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/login/lock/webui_screen_locker.h" 5 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h"
6 6
7 #include "ash/common/wm_shell.h" 7 #include "ash/common/wm_shell.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/chromeos/power/power_event_observer.h" 9 #include "ash/system/chromeos/power/power_event_observer.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 //////////////////////////////////////////////////////////////////////////////// 119 ////////////////////////////////////////////////////////////////////////////////
120 // WebUIScreenLocker implementation. 120 // WebUIScreenLocker implementation.
121 121
122 WebUIScreenLocker::WebUIScreenLocker(ScreenLocker* screen_locker) 122 WebUIScreenLocker::WebUIScreenLocker(ScreenLocker* screen_locker)
123 : WebUILoginView(BuildConfigSettings()), 123 : WebUILoginView(BuildConfigSettings()),
124 screen_locker_(screen_locker), 124 screen_locker_(screen_locker),
125 network_state_helper_(new login::NetworkStateHelper), 125 network_state_helper_(new login::NetworkStateHelper),
126 weak_factory_(this) { 126 weak_factory_(this) {
127 set_should_emit_login_prompt_visible(false); 127 set_should_emit_login_prompt_visible(false);
128 ash::WmShell::Get()->AddLockStateObserver(this); 128 ash::WmShell::Get()->AddLockStateObserver(this);
129 ash::WmShell::Get()->AddShellObserver(this); 129 ash::Shell::GetInstance()->AddShellObserver(this);
130 display::Screen::GetScreen()->AddObserver(this); 130 display::Screen::GetScreen()->AddObserver(this);
131 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); 131 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this);
132 132
133 if (keyboard::KeyboardController::GetInstance()) { 133 if (keyboard::KeyboardController::GetInstance()) {
134 keyboard::KeyboardController::GetInstance()->AddObserver(this); 134 keyboard::KeyboardController::GetInstance()->AddObserver(this);
135 is_observing_keyboard_ = true; 135 is_observing_keyboard_ = true;
136 } 136 }
137 } 137 }
138 138
139 WebUIScreenLocker::~WebUIScreenLocker() { 139 WebUIScreenLocker::~WebUIScreenLocker() {
140 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); 140 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
141 display::Screen::GetScreen()->RemoveObserver(this); 141 display::Screen::GetScreen()->RemoveObserver(this);
142 ash::WmShell::Get()->RemoveLockStateObserver(this); 142 ash::WmShell::Get()->RemoveLockStateObserver(this);
143 ash::WmShell::Get()->RemoveShellObserver(this); 143 ash::Shell::GetInstance()->RemoveShellObserver(this);
144 // In case of shutdown, lock_window_ may be deleted before WebUIScreenLocker. 144 // In case of shutdown, lock_window_ may be deleted before WebUIScreenLocker.
145 if (lock_window_) { 145 if (lock_window_) {
146 lock_window_->RemoveObserver(this); 146 lock_window_->RemoveObserver(this);
147 lock_window_->Close(); 147 lock_window_->Close();
148 } 148 }
149 // If LockScreen() was called, we need to clear the signin screen handler 149 // If LockScreen() was called, we need to clear the signin screen handler
150 // delegate set in ShowSigninScreen so that it no longer points to us. 150 // delegate set in ShowSigninScreen so that it no longer points to us.
151 if (login_display_.get() && GetOobeUI()) 151 if (login_display_.get() && GetOobeUI())
152 GetOobeUI()->ResetSigninScreenHandlerDelegate(); 152 GetOobeUI()->ResetSigninScreenHandlerDelegate();
153 153
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 } 469 }
470 470
471 if (GetOobeUI()) { 471 if (GetOobeUI()) {
472 const gfx::Size& size = primary_display.size(); 472 const gfx::Size& size = primary_display.size();
473 GetOobeUI()->GetCoreOobeView()->SetClientAreaSize(size.width(), 473 GetOobeUI()->GetCoreOobeView()->SetClientAreaSize(size.width(),
474 size.height()); 474 size.height());
475 } 475 }
476 } 476 }
477 477
478 } // namespace chromeos 478 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/wm/video_detector.cc ('k') | chrome/browser/chromeos/login/ui/login_display_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698