| 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 "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 7 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 8 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 8 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 9 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" | 9 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" |
| 10 #include "chrome/browser/chromeos/login/signin_screen_controller.h" | 10 #include "chrome/browser/chromeos/login/signin_screen_controller.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 : LoginDisplay(delegate, gfx::Rect()) {} | 45 : LoginDisplay(delegate, gfx::Rect()) {} |
| 46 | 46 |
| 47 void WebUILoginDisplay::ClearAndEnablePassword() { | 47 void WebUILoginDisplay::ClearAndEnablePassword() { |
| 48 if (webui_handler_) | 48 if (webui_handler_) |
| 49 webui_handler_->ClearAndEnablePassword(); | 49 webui_handler_->ClearAndEnablePassword(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void WebUILoginDisplay::Init(const user_manager::UserList& users, | 52 void WebUILoginDisplay::Init(const user_manager::UserList& users, |
| 53 bool show_guest, | 53 bool show_guest, |
| 54 bool show_users, | 54 bool show_users, |
| 55 bool show_new_user) { | 55 bool allow_new_user) { |
| 56 // Testing that the delegate has been set. | 56 // Testing that the delegate has been set. |
| 57 DCHECK(delegate_); | 57 DCHECK(delegate_); |
| 58 SignInScreenController::Get()->Init(users, show_guest); | 58 SignInScreenController::Get()->Init(users, show_guest); |
| 59 show_guest_ = show_guest; | 59 show_guest_ = show_guest; |
| 60 show_users_changed_ = (show_users_ != show_users); |
| 60 show_users_ = show_users; | 61 show_users_ = show_users; |
| 61 show_new_user_ = show_new_user; | 62 allow_new_user_changed_ = (allow_new_user_ != allow_new_user); |
| 63 allow_new_user_ = allow_new_user; |
| 62 | 64 |
| 63 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); | 65 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); |
| 64 if (activity_detector && !activity_detector->HasObserver(this)) | 66 if (activity_detector && !activity_detector->HasObserver(this)) |
| 65 activity_detector->AddObserver(this); | 67 activity_detector->AddObserver(this); |
| 66 } | 68 } |
| 67 | 69 |
| 68 // ---- Common methods | 70 // ---- Common methods |
| 69 | 71 |
| 70 // ---- User selection screen methods | 72 // ---- User selection screen methods |
| 71 | 73 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 297 } |
| 296 | 298 |
| 297 bool WebUILoginDisplay::IsShowGuest() const { | 299 bool WebUILoginDisplay::IsShowGuest() const { |
| 298 return show_guest_; | 300 return show_guest_; |
| 299 } | 301 } |
| 300 | 302 |
| 301 bool WebUILoginDisplay::IsShowUsers() const { | 303 bool WebUILoginDisplay::IsShowUsers() const { |
| 302 return show_users_; | 304 return show_users_; |
| 303 } | 305 } |
| 304 | 306 |
| 307 bool WebUILoginDisplay::ShowUsersHasChanged() const { |
| 308 return show_users_changed_; |
| 309 } |
| 310 |
| 311 bool WebUILoginDisplay::IsAllowNewUser() const { |
| 312 return allow_new_user_; |
| 313 } |
| 314 |
| 315 bool WebUILoginDisplay::AllowNewUserChanged() const { |
| 316 return allow_new_user_changed_; |
| 317 } |
| 318 |
| 305 bool WebUILoginDisplay::IsSigninInProgress() const { | 319 bool WebUILoginDisplay::IsSigninInProgress() const { |
| 306 return delegate_->IsSigninInProgress(); | 320 return delegate_->IsSigninInProgress(); |
| 307 } | 321 } |
| 308 | 322 |
| 309 bool WebUILoginDisplay::IsUserSigninCompleted() const { | 323 bool WebUILoginDisplay::IsUserSigninCompleted() const { |
| 310 return is_signin_completed(); | 324 return is_signin_completed(); |
| 311 } | 325 } |
| 312 | 326 |
| 313 void WebUILoginDisplay::SetDisplayEmail(const std::string& email) { | 327 void WebUILoginDisplay::SetDisplayEmail(const std::string& email) { |
| 314 if (delegate_) | 328 if (delegate_) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 325 } | 339 } |
| 326 | 340 |
| 327 bool WebUILoginDisplay::IsUserWhitelisted(const AccountId& account_id) { | 341 bool WebUILoginDisplay::IsUserWhitelisted(const AccountId& account_id) { |
| 328 DCHECK(delegate_); | 342 DCHECK(delegate_); |
| 329 if (delegate_) | 343 if (delegate_) |
| 330 return delegate_->IsUserWhitelisted(account_id); | 344 return delegate_->IsUserWhitelisted(account_id); |
| 331 return true; | 345 return true; |
| 332 } | 346 } |
| 333 | 347 |
| 334 } // namespace chromeos | 348 } // namespace chromeos |
| OLD | NEW |