| Index: chrome/browser/chromeos/login/existing_user_controller.cc
|
| diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
|
| index e6c79a7488ecb1f451d29521e114c282f7780681..ded68de472aaa570e91ad3bc8687a0b795e0e689 100644
|
| --- a/chrome/browser/chromeos/login/existing_user_controller.cc
|
| +++ b/chrome/browser/chromeos/login/existing_user_controller.cc
|
| @@ -16,7 +16,6 @@
|
| #include "base/metrics/histogram.h"
|
| #include "base/prefs/pref_service.h"
|
| #include "base/strings/string_util.h"
|
| -#include "base/strings/stringprintf.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/values.h"
|
| #include "base/version.h"
|
| @@ -24,10 +23,8 @@
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/browser_process_platform_part.h"
|
| #include "chrome/browser/chrome_notification_types.h"
|
| -#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
|
| #include "chrome/browser/chromeos/boot_times_loader.h"
|
| #include "chrome/browser/chromeos/customization_document.h"
|
| -#include "chrome/browser/chromeos/first_run/first_run.h"
|
| #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
|
| #include "chrome/browser/chromeos/login/helper.h"
|
| #include "chrome/browser/chromeos/login/login_utils.h"
|
| @@ -42,7 +39,6 @@
|
| #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
|
| #include "chrome/browser/chromeos/profiles/profile_helper.h"
|
| #include "chrome/browser/chromeos/settings/cros_settings.h"
|
| -#include "chrome/browser/prefs/session_startup_pref.h"
|
| #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/chrome_version_info.h"
|
| @@ -88,11 +84,6 @@ namespace {
|
| const char kCreateAccountURL[] =
|
| "https://accounts.google.com/NewAccount?service=mail";
|
|
|
| -// ChromeVox tutorial URL (used in place of "getting started" url when
|
| -// accessibility is enabled).
|
| -const char kChromeVoxTutorialURLPattern[] =
|
| - "http://www.chromevox.com/tutorial/index.html?lang=%s";
|
| -
|
| // Delay for transferring the auth cache to the system profile.
|
| const long int kAuthCacheTransferDelayMs = 2000;
|
|
|
| @@ -447,7 +438,7 @@ void ExistingUserController::Login(const UserContext& user_context,
|
| void ExistingUserController::PerformLogin(
|
| const UserContext& user_context,
|
| LoginPerformer::AuthorizationMode auth_mode) {
|
| - ChromeUserManager::Get()->GetUserFlow(last_login_attempt_username_)->set_host(
|
| + ChromeUserManager::Get()->GetUserFlow(user_context.GetUserID())->set_host(
|
| host_);
|
|
|
| BootTimesLoader::Get()->RecordLoginAttempted();
|
| @@ -875,46 +866,20 @@ void ExistingUserController::OnAuthSuccess(const UserContext& user_context) {
|
| }
|
| }
|
|
|
| -void ExistingUserController::OnProfilePrepared(Profile* profile) {
|
| +void ExistingUserController::OnProfilePrepared(Profile* profile,
|
| + bool browser_launched) {
|
| // Reenable clicking on other windows and status area.
|
| login_display_->SetUIEnabled(true);
|
|
|
| - user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
| - if (user_manager->IsCurrentUserNew() &&
|
| - user_manager->IsLoggedInAsSupervisedUser()) {
|
| - // Supervised users should launch into empty desktop on first run.
|
| - CommandLine::ForCurrentProcess()->AppendSwitch(::switches::kSilentLaunch);
|
| - }
|
| -
|
| - if (user_manager->IsCurrentUserNew() &&
|
| - !ChromeUserManager::Get()
|
| - ->GetCurrentUserFlow()
|
| - ->ShouldSkipPostLoginScreens() &&
|
| - !WizardController::default_controller()->skip_post_login_screens()) {
|
| - // Don't specify start URLs if the administrator has configured the start
|
| - // URLs via policy.
|
| - if (!SessionStartupPref::TypeIsManaged(profile->GetPrefs()))
|
| - InitializeStartUrls();
|
| -
|
| - // Mark the device as registered., i.e. the second part of OOBE as
|
| - // completed.
|
| - if (!StartupUtils::IsDeviceRegistered())
|
| - StartupUtils::MarkDeviceRegistered(base::Closure());
|
| -
|
| - if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| - chromeos::switches::kOobeSkipPostLogin)) {
|
| - LoginUtils::Get()->DoBrowserLaunch(profile, host_);
|
| - host_ = NULL;
|
| - } else {
|
| - ActivateWizard(WizardController::kTermsOfServiceScreenName);
|
| - }
|
| - } else {
|
| - LoginUtils::Get()->DoBrowserLaunch(profile, host_);
|
| + if (browser_launched)
|
| host_ = NULL;
|
| - }
|
| +
|
| // Inform |auth_status_consumer_| about successful login.
|
| - if (auth_status_consumer_)
|
| - auth_status_consumer_->OnAuthSuccess(UserContext());
|
| + // TODO(nkostylev): Pass UserContext back crbug.com/424550
|
| + if (auth_status_consumer_) {
|
| + auth_status_consumer_->
|
| + OnAuthSuccess(UserContext(last_login_attempt_username_));
|
| + }
|
| }
|
|
|
| void ExistingUserController::OnOffTheRecordAuthSuccess() {
|
| @@ -1023,11 +988,6 @@ void ExistingUserController::DeviceSettingsChanged() {
|
| }
|
| }
|
|
|
| -void ExistingUserController::ActivateWizard(const std::string& screen_name) {
|
| - scoped_ptr<base::DictionaryValue> params;
|
| - host_->StartWizard(screen_name, params.Pass());
|
| -}
|
| -
|
| LoginPerformer::AuthorizationMode ExistingUserController::auth_mode() const {
|
| if (login_performer_)
|
| return login_performer_->auth_mode();
|
| @@ -1122,56 +1082,6 @@ gfx::NativeWindow ExistingUserController::GetNativeWindow() const {
|
| return host_->GetNativeWindow();
|
| }
|
|
|
| -void ExistingUserController::InitializeStartUrls() const {
|
| - std::vector<std::string> start_urls;
|
| -
|
| - const base::ListValue *urls;
|
| - user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
| - bool can_show_getstarted_guide =
|
| - user_manager->GetActiveUser()->GetType() ==
|
| - user_manager::USER_TYPE_REGULAR &&
|
| - !user_manager->IsCurrentUserNonCryptohomeDataEphemeral();
|
| - if (user_manager->IsLoggedInAsDemoUser()) {
|
| - if (CrosSettings::Get()->GetList(kStartUpUrls, &urls)) {
|
| - // The retail mode user will get start URLs from a special policy if it is
|
| - // set.
|
| - for (base::ListValue::const_iterator it = urls->begin();
|
| - it != urls->end(); ++it) {
|
| - std::string url;
|
| - if ((*it)->GetAsString(&url))
|
| - start_urls.push_back(url);
|
| - }
|
| - }
|
| - can_show_getstarted_guide = false;
|
| - // Skip the default first-run behavior for public accounts.
|
| - } else if (!user_manager->IsLoggedInAsPublicAccount()) {
|
| - if (AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) {
|
| - const char* url = kChromeVoxTutorialURLPattern;
|
| - PrefService* prefs = g_browser_process->local_state();
|
| - const std::string current_locale =
|
| - base::StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale));
|
| - std::string vox_url = base::StringPrintf(url, current_locale.c_str());
|
| - start_urls.push_back(vox_url);
|
| - can_show_getstarted_guide = false;
|
| - }
|
| - }
|
| -
|
| - // Only show getting started guide for a new user.
|
| - const bool should_show_getstarted_guide = user_manager->IsCurrentUserNew();
|
| -
|
| - if (can_show_getstarted_guide && should_show_getstarted_guide) {
|
| - // Don't open default Chrome window if we're going to launch the first-run
|
| - // app. Because we dont' want the first-run app to be hidden in the
|
| - // background.
|
| - CommandLine::ForCurrentProcess()->AppendSwitch(::switches::kSilentLaunch);
|
| - first_run::MaybeLaunchDialogAfterSessionStart();
|
| - } else {
|
| - for (size_t i = 0; i < start_urls.size(); ++i) {
|
| - CommandLine::ForCurrentProcess()->AppendArg(start_urls[i]);
|
| - }
|
| - }
|
| -}
|
| -
|
| void ExistingUserController::ShowError(int error_id,
|
| const std::string& details) {
|
| // TODO(dpolukhin): show detailed error info. |details| string contains
|
|
|