| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/stringprintf.h" |
| 10 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 10 #include "base/values.h" | 12 #include "base/values.h" |
| 11 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/chromeos/boot_times_loader.h" | 14 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 13 #include "chrome/browser/chromeos/cros/cros_library.h" | 15 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 14 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 16 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
| 15 #include "chrome/browser/chromeos/cros/login_library.h" | 17 #include "chrome/browser/chromeos/cros/login_library.h" |
| 16 #include "chrome/browser/chromeos/cros/network_library.h" | 18 #include "chrome/browser/chromeos/cros/network_library.h" |
| 17 #include "chrome/browser/chromeos/customization_document.h" | 19 #include "chrome/browser/chromeos/customization_document.h" |
| 18 #include "chrome/browser/chromeos/login/helper.h" | 20 #include "chrome/browser/chromeos/login/helper.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 36 #include "views/window/window.h" | 38 #include "views/window/window.h" |
| 37 | 39 |
| 38 namespace chromeos { | 40 namespace chromeos { |
| 39 | 41 |
| 40 namespace { | 42 namespace { |
| 41 | 43 |
| 42 // Url for setting up sync authentication. | 44 // Url for setting up sync authentication. |
| 43 const char kSettingsSyncLoginURL[] = "chrome://settings/personal"; | 45 const char kSettingsSyncLoginURL[] = "chrome://settings/personal"; |
| 44 | 46 |
| 45 // URL that will be opened on when user logs in first time on the device. | 47 // URL that will be opened on when user logs in first time on the device. |
| 46 const char kGetStartedURL[] = | 48 const char kGetStartedURLPattern[] = |
| 47 "chrome-extension://cbmhffdpiobpchciemffincgahkkljig/index.html"; | 49 "http://services.google.com/chromeos/gettingstarted/index-%s.html"; |
| 48 | 50 |
| 49 // URL for account creation. | 51 // URL for account creation. |
| 50 const char kCreateAccountURL[] = | 52 const char kCreateAccountURL[] = |
| 51 "https://www.google.com/accounts/NewAccount?service=mail"; | 53 "https://www.google.com/accounts/NewAccount?service=mail"; |
| 52 | 54 |
| 53 // Landing URL when launching Guest mode to fix captive portal. | 55 // Landing URL when launching Guest mode to fix captive portal. |
| 54 const char kCaptivePortalLaunchURL[] = "http://www.google.com/"; | 56 const char kCaptivePortalLaunchURL[] = "http://www.google.com/"; |
| 55 | 57 |
| 56 } // namespace | 58 } // namespace |
| 57 | 59 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 334 |
| 333 | 335 |
| 334 if (login_status_consumer_) | 336 if (login_status_consumer_) |
| 335 login_status_consumer_->OnLoginSuccess(username, password, | 337 login_status_consumer_->OnLoginSuccess(username, password, |
| 336 credentials, pending_requests); | 338 credentials, pending_requests); |
| 337 } | 339 } |
| 338 | 340 |
| 339 void ExistingUserController::OnProfilePrepared(Profile* profile) { | 341 void ExistingUserController::OnProfilePrepared(Profile* profile) { |
| 340 // TODO(nkostylev): May add login UI implementation callback call. | 342 // TODO(nkostylev): May add login UI implementation callback call. |
| 341 if (!ready_for_browser_launch_) { | 343 if (!ready_for_browser_launch_) { |
| 342 #if defined(OFFICIAL_BUILD) | 344 PrefService* prefs = g_browser_process->local_state(); |
| 343 CommandLine::ForCurrentProcess()->AppendArg(kGetStartedURL); | 345 const std::string current_locale = |
| 344 #endif // OFFICIAL_BUILD | 346 StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale)); |
| 347 std::string start_url = |
| 348 base::StringPrintf(kGetStartedURLPattern, current_locale.c_str()); |
| 349 CommandLine::ForCurrentProcess()->AppendArg(start_url); |
| 345 | 350 |
| 346 ServicesCustomizationDocument* customization = | 351 ServicesCustomizationDocument* customization = |
| 347 ServicesCustomizationDocument::GetInstance(); | 352 ServicesCustomizationDocument::GetInstance(); |
| 348 if (!ServicesCustomizationDocument::WasApplied() && | 353 if (!ServicesCustomizationDocument::WasApplied() && |
| 349 customization->IsReady()) { | 354 customization->IsReady()) { |
| 350 std::string locale = g_browser_process->GetApplicationLocale(); | 355 std::string locale = g_browser_process->GetApplicationLocale(); |
| 351 std::string initial_start_page = | 356 std::string initial_start_page = |
| 352 customization->GetInitialStartPage(locale); | 357 customization->GetInitialStartPage(locale); |
| 353 if (!initial_start_page.empty()) | 358 if (!initial_start_page.empty()) |
| 354 CommandLine::ForCurrentProcess()->AppendArg(initial_start_page); | 359 CommandLine::ForCurrentProcess()->AppendArg(initial_start_page); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 } | 507 } |
| 503 if (CrosLibrary::Get()->EnsureLoaded()) { | 508 if (CrosLibrary::Get()->EnsureLoaded()) { |
| 504 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary(); | 509 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary(); |
| 505 cryptohomed->AsyncSetOwnerUser( | 510 cryptohomed->AsyncSetOwnerUser( |
| 506 UserCrosSettingsProvider::cached_owner(), NULL); | 511 UserCrosSettingsProvider::cached_owner(), NULL); |
| 507 cryptohomed->AsyncDoAutomaticFreeDiskSpaceControl(NULL); | 512 cryptohomed->AsyncDoAutomaticFreeDiskSpaceControl(NULL); |
| 508 } | 513 } |
| 509 } | 514 } |
| 510 | 515 |
| 511 } // namespace chromeos | 516 } // namespace chromeos |
| OLD | NEW |