OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/webui/chromeos/login/gaia_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Account creation depends on Guest sign-in (http://crosbug.com/24570). | 45 // Account creation depends on Guest sign-in (http://crosbug.com/24570). |
46 params->SetBoolean("createAccount", allow_new_user && allow_guest); | 46 params->SetBoolean("createAccount", allow_new_user && allow_guest); |
47 params->SetBoolean("guestSignin", allow_guest); | 47 params->SetBoolean("guestSignin", allow_guest); |
48 | 48 |
49 // Allow locally managed user creation only if: | 49 // Allow locally managed user creation only if: |
50 // 1. Enterprise managed device > is allowed by policy. | 50 // 1. Enterprise managed device > is allowed by policy. |
51 // 2. Consumer device > owner exists. | 51 // 2. Consumer device > owner exists. |
52 // 3. New users are allowed by owner. | 52 // 3. New users are allowed by owner. |
53 // 4. Supervised users are allowed by owner. | 53 // 4. Supervised users are allowed by owner. |
54 bool managed_users_allowed = | 54 bool managed_users_allowed = |
55 UserManager::Get()->AreLocallyManagedUsersAllowed(); | 55 GetUserManager()->AreLocallyManagedUsersAllowed(); |
56 bool managed_users_can_create = true; | 56 bool managed_users_can_create = true; |
57 int message_id = -1; | 57 int message_id = -1; |
58 if (!has_users) { | 58 if (!has_users) { |
59 managed_users_can_create = false; | 59 managed_users_can_create = false; |
60 message_id = IDS_CREATE_LOCALLY_MANAGED_USER_NO_MANAGER_TEXT; | 60 message_id = IDS_CREATE_LOCALLY_MANAGED_USER_NO_MANAGER_TEXT; |
61 } | 61 } |
62 if (!allow_new_user || !managed_users_allowed) { | 62 if (!allow_new_user || !managed_users_allowed) { |
63 managed_users_can_create = false; | 63 managed_users_can_create = false; |
64 message_id = IDS_CREATE_LOCALLY_MANAGED_USER_CREATION_RESTRICTED_TEXT; | 64 message_id = IDS_CREATE_LOCALLY_MANAGED_USER_CREATION_RESTRICTED_TEXT; |
65 } | 65 } |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 539 |
540 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 540 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
541 DCHECK(signin_screen_handler_); | 541 DCHECK(signin_screen_handler_); |
542 return signin_screen_handler_->delegate_; | 542 return signin_screen_handler_->delegate_; |
543 } | 543 } |
544 | 544 |
545 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { | 545 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { |
546 signin_screen_handler_ = handler; | 546 signin_screen_handler_ = handler; |
547 } | 547 } |
548 } // namespace chromeos | 548 } // namespace chromeos |
OLD | NEW |