OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/signin_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
11 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
12 #include "base/string16.h" | 13 #include "base/string16.h" |
13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
14 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
15 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/browser_shutdown.h" | 18 #include "chrome/browser/browser_shutdown.h" |
18 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
19 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 | 1075 |
1075 void SigninScreenHandler::HandleLaunchIncognito() { | 1076 void SigninScreenHandler::HandleLaunchIncognito() { |
1076 if (delegate_) | 1077 if (delegate_) |
1077 delegate_->LoginAsGuest(); | 1078 delegate_->LoginAsGuest(); |
1078 } | 1079 } |
1079 | 1080 |
1080 void SigninScreenHandler::HandleShowLocallyManagedUserCreationScreen() { | 1081 void SigninScreenHandler::HandleShowLocallyManagedUserCreationScreen() { |
1081 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1082 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1082 if (!command_line->HasSwitch(::switches::kEnableManagedUsers)) | 1083 if (!command_line->HasSwitch(::switches::kEnableManagedUsers)) |
1083 return; | 1084 return; |
| 1085 scoped_ptr<DictionaryValue> params(new DictionaryValue()); |
1084 LoginDisplayHostImpl::default_host()-> | 1086 LoginDisplayHostImpl::default_host()-> |
1085 StartWizard(WizardController::kLocallyManagedUserCreationScreenName, | 1087 StartWizard(WizardController::kLocallyManagedUserCreationScreenName, |
1086 NULL); | 1088 params.Pass()); |
1087 } | 1089 } |
1088 | 1090 |
1089 void SigninScreenHandler::HandleLaunchPublicAccount( | 1091 void SigninScreenHandler::HandleLaunchPublicAccount( |
1090 const std::string& username) { | 1092 const std::string& username) { |
1091 if (delegate_) | 1093 if (delegate_) |
1092 delegate_->LoginAsPublicAccount(username); | 1094 delegate_->LoginAsPublicAccount(username); |
1093 } | 1095 } |
1094 | 1096 |
1095 void SigninScreenHandler::HandleOfflineLogin(const base::ListValue* args) { | 1097 void SigninScreenHandler::HandleOfflineLogin(const base::ListValue* args) { |
1096 if (!delegate_ || delegate_->IsShowUsers()) { | 1098 if (!delegate_ || delegate_->IsShowUsers()) { |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 if (!cros_settings) | 1559 if (!cros_settings) |
1558 return false; | 1560 return false; |
1559 | 1561 |
1560 // Offline login is allowed only when user pods are hidden. | 1562 // Offline login is allowed only when user pods are hidden. |
1561 bool show_pods; | 1563 bool show_pods; |
1562 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); | 1564 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); |
1563 return !show_pods; | 1565 return !show_pods; |
1564 } | 1566 } |
1565 | 1567 |
1566 } // namespace chromeos | 1568 } // namespace chromeos |
OLD | NEW |