OLD | NEW |
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/ui/webui_login_display.h" | 5 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 8 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
9 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 9 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
10 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 10 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 if (webui_handler_) | 113 if (webui_handler_) |
114 webui_handler_->OnPreferencesChanged(); | 114 webui_handler_->OnPreferencesChanged(); |
115 } | 115 } |
116 | 116 |
117 void WebUILoginDisplay::SetUIEnabled(bool is_enabled) { | 117 void WebUILoginDisplay::SetUIEnabled(bool is_enabled) { |
118 // TODO(nkostylev): Cleanup this condition, | 118 // TODO(nkostylev): Cleanup this condition, |
119 // see http://crbug.com/157885 and http://crbug.com/158255. | 119 // see http://crbug.com/157885 and http://crbug.com/158255. |
120 // Allow this call only before user sign in or at lock screen. | 120 // Allow this call only before user sign in or at lock screen. |
121 // If this call is made after new user signs in but login screen is still | 121 // If this call is made after new user signs in but login screen is still |
122 // around that would trigger a sign in extension refresh. | 122 // around that would trigger a sign in extension refresh. |
123 if (is_enabled && (!UserManager::Get()->IsUserLoggedIn() || | 123 if (is_enabled && (!GetUserManager()->IsUserLoggedIn() || |
124 ScreenLocker::default_screen_locker())) { | 124 ScreenLocker::default_screen_locker())) { |
125 ClearAndEnablePassword(); | 125 ClearAndEnablePassword(); |
126 } | 126 } |
127 | 127 |
128 if (chromeos::LoginDisplayHost* host = | 128 if (chromeos::LoginDisplayHost* host = |
129 chromeos::LoginDisplayHostImpl::default_host()) { | 129 chromeos::LoginDisplayHostImpl::default_host()) { |
130 if (chromeos::WebUILoginView* login_view = host->GetWebUILoginView()) | 130 if (chromeos::WebUILoginView* login_view = host->GetWebUILoginView()) |
131 login_view->SetUIEnabled(is_enabled); | 131 login_view->SetUIEnabled(is_enabled); |
132 } | 132 } |
133 } | 133 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 void WebUILoginDisplay::LoadSigninWallpaper() { | 267 void WebUILoginDisplay::LoadSigninWallpaper() { |
268 WallpaperManager::Get()->SetDefaultWallpaperDelayed(UserManager::kSignInUser); | 268 WallpaperManager::Get()->SetDefaultWallpaperDelayed(UserManager::kSignInUser); |
269 } | 269 } |
270 | 270 |
271 void WebUILoginDisplay::OnSigninScreenReady() { | 271 void WebUILoginDisplay::OnSigninScreenReady() { |
272 if (delegate_) | 272 if (delegate_) |
273 delegate_->OnSigninScreenReady(); | 273 delegate_->OnSigninScreenReady(); |
274 } | 274 } |
275 | 275 |
276 void WebUILoginDisplay::RemoveUser(const std::string& username) { | 276 void WebUILoginDisplay::RemoveUser(const std::string& username) { |
277 UserManager::Get()->RemoveUser(username, this); | 277 GetUserManager()->RemoveUser(username, this); |
278 } | 278 } |
279 | 279 |
280 void WebUILoginDisplay::ResyncUserData() { | 280 void WebUILoginDisplay::ResyncUserData() { |
281 DCHECK(delegate_); | 281 DCHECK(delegate_); |
282 if (delegate_) | 282 if (delegate_) |
283 delegate_->ResyncUserData(); | 283 delegate_->ResyncUserData(); |
284 } | 284 } |
285 | 285 |
286 void WebUILoginDisplay::ShowEnterpriseEnrollmentScreen() { | 286 void WebUILoginDisplay::ShowEnterpriseEnrollmentScreen() { |
287 if (delegate_) | 287 if (delegate_) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 delegate_->Signout(); | 342 delegate_->Signout(); |
343 } | 343 } |
344 | 344 |
345 void WebUILoginDisplay::OnUserActivity(const ui::Event* event) { | 345 void WebUILoginDisplay::OnUserActivity(const ui::Event* event) { |
346 if (delegate_) | 346 if (delegate_) |
347 delegate_->ResetPublicSessionAutoLoginTimer(); | 347 delegate_->ResetPublicSessionAutoLoginTimer(); |
348 } | 348 } |
349 | 349 |
350 | 350 |
351 } // namespace chromeos | 351 } // namespace chromeos |
OLD | NEW |