Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 6893052: Make customization documents singletons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments resolved Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chromeos/boot_times_loader.h" 12 #include "chrome/browser/chromeos/boot_times_loader.h"
13 #include "chrome/browser/chromeos/cros/cros_library.h" 13 #include "chrome/browser/chromeos/cros/cros_library.h"
14 #include "chrome/browser/chromeos/cros/cryptohome_library.h" 14 #include "chrome/browser/chromeos/cros/cryptohome_library.h"
15 #include "chrome/browser/chromeos/cros/login_library.h" 15 #include "chrome/browser/chromeos/cros/login_library.h"
16 #include "chrome/browser/chromeos/cros/network_library.h" 16 #include "chrome/browser/chromeos/cros/network_library.h"
17 #include "chrome/browser/chromeos/customization_document.h"
17 #include "chrome/browser/chromeos/login/helper.h" 18 #include "chrome/browser/chromeos/login/helper.h"
18 #include "chrome/browser/chromeos/login/login_display_host.h" 19 #include "chrome/browser/chromeos/login/login_display_host.h"
19 #include "chrome/browser/chromeos/login/views_login_display.h" 20 #include "chrome/browser/chromeos/login/views_login_display.h"
20 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" 21 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h"
21 #include "chrome/browser/chromeos/login/wizard_controller.h" 22 #include "chrome/browser/chromeos/login/wizard_controller.h"
22 #include "chrome/browser/chromeos/status/status_area_view.h" 23 #include "chrome/browser/chromeos/status/status_area_view.h"
23 #include "chrome/browser/chromeos/user_cros_settings_provider.h" 24 #include "chrome/browser/chromeos/user_cros_settings_provider.h"
24 #include "chrome/browser/google/google_util.h" 25 #include "chrome/browser/google/google_util.h"
25 #include "chrome/browser/prefs/pref_service.h" 26 #include "chrome/browser/prefs/pref_service.h"
26 #include "chrome/browser/profiles/profile_manager.h" 27 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 if (command_line->HasSwitch(switches::kEnableDevicePolicy)) { 220 if (command_line->HasSwitch(switches::kEnableDevicePolicy)) {
220 ownership_checker_.reset(new OwnershipStatusChecker(NewCallback( 221 ownership_checker_.reset(new OwnershipStatusChecker(NewCallback(
221 this, &ExistingUserController::OnEnrollmentOwnershipCheckCompleted))); 222 this, &ExistingUserController::OnEnrollmentOwnershipCheckCompleted)));
222 } 223 }
223 } 224 }
224 225
225 void ExistingUserController::OnEnrollmentOwnershipCheckCompleted( 226 void ExistingUserController::OnEnrollmentOwnershipCheckCompleted(
226 OwnershipService::Status status) { 227 OwnershipService::Status status) {
227 if (status == OwnershipService::OWNERSHIP_NONE) { 228 if (status == OwnershipService::OWNERSHIP_NONE) {
228 host_->StartWizard(WizardController::kEnterpriseEnrollmentScreenName, 229 host_->StartWizard(WizardController::kEnterpriseEnrollmentScreenName,
229 NULL, GURL()); 230 GURL());
230 login_display_->OnFadeOut(); 231 login_display_->OnFadeOut();
231 } 232 }
232 ownership_checker_.reset(); 233 ownership_checker_.reset();
233 } 234 }
234 235
235 //////////////////////////////////////////////////////////////////////////////// 236 ////////////////////////////////////////////////////////////////////////////////
236 // ExistingUserController, LoginPerformer::Delegate implementation: 237 // ExistingUserController, LoginPerformer::Delegate implementation:
237 // 238 //
238 239
239 void ExistingUserController::OnLoginFailure(const LoginFailure& failure) { 240 void ExistingUserController::OnLoginFailure(const LoginFailure& failure) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 328
328 } 329 }
329 330
330 void ExistingUserController::OnProfilePrepared(Profile* profile) { 331 void ExistingUserController::OnProfilePrepared(Profile* profile) {
331 // TODO(nkostylev): May add login UI implementation callback call. 332 // TODO(nkostylev): May add login UI implementation callback call.
332 if (!ready_for_browser_launch_) { 333 if (!ready_for_browser_launch_) {
333 #if defined(OFFICIAL_BUILD) 334 #if defined(OFFICIAL_BUILD)
334 CommandLine::ForCurrentProcess()->AppendArg(kGetStartedURL); 335 CommandLine::ForCurrentProcess()->AppendArg(kGetStartedURL);
335 #endif // OFFICIAL_BUILD 336 #endif // OFFICIAL_BUILD
336 337
337 if (!initial_start_page_.empty()) { 338 ServicesCustomizationDocument* customization =
338 // If initial_start_page is not empty, add it as second tab. 339 ServicesCustomizationDocument::GetInstance();
339 // The tabs are opened in the same order as arguments in command line. 340 if (customization->IsReady()) {
340 CommandLine::ForCurrentProcess()->AppendArg(initial_start_page_); 341 std::string locale = g_browser_process->GetApplicationLocale();
342 std::string initial_start_page =
343 customization->GetInitialStartPage(locale);
344 if (!initial_start_page.empty())
345 CommandLine::ForCurrentProcess()->AppendArg(initial_start_page);
346 customization->ApplyCustomization();
341 } 347 }
342 348
343 if (two_factor_credentials_) { 349 if (two_factor_credentials_) {
344 // If we have a two factor error and and this is a new user, 350 // If we have a two factor error and and this is a new user,
345 // load the personal settings page. 351 // load the personal settings page.
346 // TODO(stevenjb): direct the user to a lightweight sync login page. 352 // TODO(stevenjb): direct the user to a lightweight sync login page.
347 CommandLine::ForCurrentProcess()->AppendArg(kSettingsSyncLoginURL); 353 CommandLine::ForCurrentProcess()->AppendArg(kSettingsSyncLoginURL);
348 } 354 }
349 355
350 ActivateWizard(WizardController::IsDeviceRegistered() ? 356 ActivateWizard(WizardController::IsDeviceRegistered() ?
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 login_performer_->ResyncEncryptedData(); 430 login_performer_->ResyncEncryptedData();
425 } 431 }
426 432
427 //////////////////////////////////////////////////////////////////////////////// 433 ////////////////////////////////////////////////////////////////////////////////
428 // ExistingUserController, private: 434 // ExistingUserController, private:
429 435
430 void ExistingUserController::ActivateWizard(const std::string& screen_name) { 436 void ExistingUserController::ActivateWizard(const std::string& screen_name) {
431 GURL start_url; 437 GURL start_url;
432 if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) 438 if (chromeos::UserManager::Get()->IsLoggedInAsGuest())
433 start_url = guest_mode_url_; 439 start_url = guest_mode_url_;
434 host_->StartWizard(screen_name, NULL, start_url); 440 host_->StartWizard(screen_name, start_url);
435 login_display_->OnFadeOut(); 441 login_display_->OnFadeOut();
436 } 442 }
437 443
438 gfx::NativeWindow ExistingUserController::GetNativeWindow() const { 444 gfx::NativeWindow ExistingUserController::GetNativeWindow() const {
439 return host_->GetNativeWindow(); 445 return host_->GetNativeWindow();
440 } 446 }
441 447
442 void ExistingUserController::SetStatusAreaEnabled(bool enable) { 448 void ExistingUserController::SetStatusAreaEnabled(bool enable) {
443 host_->SetStatusAreaEnabled(enable); 449 host_->SetStatusAreaEnabled(enable);
444 } 450 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 } 488 }
483 if (CrosLibrary::Get()->EnsureLoaded()) { 489 if (CrosLibrary::Get()->EnsureLoaded()) {
484 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary(); 490 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary();
485 cryptohomed->AsyncSetOwnerUser( 491 cryptohomed->AsyncSetOwnerUser(
486 UserCrosSettingsProvider::cached_owner(), NULL); 492 UserCrosSettingsProvider::cached_owner(), NULL);
487 cryptohomed->AsyncDoAutomaticFreeDiskSpaceControl(NULL); 493 cryptohomed->AsyncDoAutomaticFreeDiskSpaceControl(NULL);
488 } 494 }
489 } 495 }
490 496
491 } // namespace chromeos 497 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698