Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 std::string username = | 377 std::string username = |
| 378 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser); | 378 parsed_command_line().GetSwitchValueASCII(switches::kLoginUser); |
| 379 VLOG(1) << "Relaunching browser for user: " << username; | 379 VLOG(1) << "Relaunching browser for user: " << username; |
| 380 chromeos::UserManager::Get()->UserLoggedIn(username, true); | 380 chromeos::UserManager::Get()->UserLoggedIn(username, true); |
| 381 | 381 |
| 382 // Redirects Chrome logging to the user data dir. | 382 // Redirects Chrome logging to the user data dir. |
| 383 logging::RedirectChromeLogging(parsed_command_line()); | 383 logging::RedirectChromeLogging(parsed_command_line()); |
| 384 | 384 |
| 385 // Initialize user policy before creating the profile so the profile | 385 // Initialize user policy before creating the profile so the profile |
| 386 // initialization code sees policy settings. | 386 // initialization code sees policy settings. |
| 387 g_browser_process->browser_policy_connector()->InitializeUserPolicy( | 387 // Guest accounts are not subject to user policy. |
| 388 username, false /* wait_for_policy_fetch */); | 388 if (!chromeos::UserManager::Get()->IsLoggedInAsGuest()) { |
| 389 chromeos::UserManager::Get()->SessionStarted(); | 389 g_browser_process->browser_policy_connector()->InitializeUserPolicy( |
| 390 username, false /* wait_for_policy_fetch */); | |
| 391 chromeos::UserManager::Get()->SessionStarted(); | |
|
Dmitry Polukhin
2012/08/30 08:48:53
Putting SessionStarted into !IsLoggedInAsGuest bro
| |
| 392 } | |
| 390 } | 393 } |
| 391 | 394 |
| 392 // In Aura builds this will initialize ash::Shell. | 395 // In Aura builds this will initialize ash::Shell. |
| 393 ChromeBrowserMainPartsLinux::PreProfileInit(); | 396 ChromeBrowserMainPartsLinux::PreProfileInit(); |
| 394 } | 397 } |
| 395 | 398 |
| 396 void ChromeBrowserMainPartsChromeos::PostProfileInit() { | 399 void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
| 397 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 400 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 398 // -- just after CreateProfile(). | 401 // -- just after CreateProfile(). |
| 399 | 402 |
| 400 if (parsed_command_line().HasSwitch(switches::kLoginUser) && | 403 if (parsed_command_line().HasSwitch(switches::kLoginUser) && |
| 401 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { | 404 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { |
| 402 // Pass the TokenService pointer to the policy connector so user policy can | 405 // Pass the TokenService pointer to the policy connector so user policy can |
| 403 // grab a token and register with the policy server. | 406 // grab a token and register with the policy server. |
| 404 // TODO(mnissler): Remove once OAuth is the only authentication mechanism. | 407 // TODO(mnissler): Remove once OAuth is the only authentication mechanism. |
| 405 g_browser_process->browser_policy_connector()->SetUserPolicyTokenService( | 408 g_browser_process->browser_policy_connector()->SetUserPolicyTokenService( |
| 406 TokenServiceFactory::GetForProfile(profile())); | 409 TokenServiceFactory::GetForProfile(profile())); |
| 407 | 410 |
| 408 // Make sure we flip every profile to not share proxies if the user hasn't | 411 // Make sure we flip every profile to not share proxies if the user hasn't |
| 409 // specified so explicitly. | 412 // specified so explicitly. |
| 410 const PrefService::Preference* use_shared_proxies_pref = | 413 const PrefService::Preference* use_shared_proxies_pref = |
| 411 profile()->GetPrefs()->FindPreference(prefs::kUseSharedProxies); | 414 profile()->GetPrefs()->FindPreference(prefs::kUseSharedProxies); |
| 412 if (use_shared_proxies_pref->IsDefaultValue()) | 415 if (use_shared_proxies_pref->IsDefaultValue()) |
| 413 profile()->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false); | 416 profile()->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false); |
| 414 } | 417 } |
| 415 | 418 |
| 416 if (parsed_command_line().HasSwitch(switches::kEnableONCPolicy)) { | 419 network_config_updater_.reset( |
| 417 network_config_updater_.reset( | 420 new policy::NetworkConfigurationUpdater( |
| 418 new policy::NetworkConfigurationUpdater( | 421 g_browser_process->policy_service(), |
| 419 g_browser_process->policy_service(), | 422 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); |
| 420 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); | |
| 421 } | |
| 422 | 423 |
| 423 // Make sure that wallpaper boot transition and other delays in OOBE | 424 // Make sure that wallpaper boot transition and other delays in OOBE |
| 424 // are disabled for tests by default. | 425 // are disabled for tests by default. |
| 425 // Individual tests may enable them if they want. | 426 // Individual tests may enable them if they want. |
| 426 if (parsed_command_line().HasSwitch(switches::kTestType)) | 427 if (parsed_command_line().HasSwitch(switches::kTestType)) |
| 427 chromeos::WizardController::SetZeroDelays(); | 428 chromeos::WizardController::SetZeroDelays(); |
| 428 | 429 |
| 429 // Tests should be able to tune login manager before showing it. | 430 // Tests should be able to tune login manager before showing it. |
| 430 // Thus only show login manager in normal (non-testing) mode. | 431 // Thus only show login manager in normal (non-testing) mode. |
| 431 if (!parameters().ui_task) | 432 if (!parameters().ui_task) |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 588 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; | 589 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; |
| 589 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); | 590 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); |
| 590 } else if (trial->group() == margin_200mb) { | 591 } else if (trial->group() == margin_200mb) { |
| 591 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; | 592 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; |
| 592 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); | 593 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); |
| 593 } else { | 594 } else { |
| 594 LOG(WARNING) << "low_mem: Part of 'default' experiment"; | 595 LOG(WARNING) << "low_mem: Part of 'default' experiment"; |
| 595 } | 596 } |
| 596 } | 597 } |
| 597 } | 598 } |
| OLD | NEW |