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 "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 408 g_browser_process->browser_policy_connector()->InitializeUserPolicy( | 408 g_browser_process->browser_policy_connector()->InitializeUserPolicy( |
| 409 username, false /* wait_for_policy_fetch */); | 409 username, false /* wait_for_policy_fetch */); |
| 410 } | 410 } |
| 411 chromeos::UserManager::Get()->SessionStarted(); | 411 chromeos::UserManager::Get()->SessionStarted(); |
| 412 } | 412 } |
| 413 | 413 |
| 414 // In Aura builds this will initialize ash::Shell. | 414 // In Aura builds this will initialize ash::Shell. |
| 415 ChromeBrowserMainPartsLinux::PreProfileInit(); | 415 ChromeBrowserMainPartsLinux::PreProfileInit(); |
| 416 } | 416 } |
| 417 | 417 |
| 418 void ChromeBrowserMainPartsChromeos::PostProfileInit() { | 418 void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
|
Mattias Nissler (ping if slow)
2012/09/04 09:57:04
Does this also run for the login profile? I guess
Joao da Silva
2012/09/04 12:52:55
Yikes, of course. This means that the NetworkConfi
| |
| 419 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 419 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 420 // -- just after CreateProfile(). | 420 // -- just after CreateProfile(). |
| 421 | 421 |
| 422 policy::BrowserPolicyConnector* connector = | |
| 423 g_browser_process->browser_policy_connector(); | |
| 424 | |
| 422 if (parsed_command_line().HasSwitch(switches::kLoginUser) && | 425 if (parsed_command_line().HasSwitch(switches::kLoginUser) && |
| 423 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { | 426 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { |
| 424 // Pass the TokenService pointer to the policy connector so user policy can | 427 // Pass the TokenService pointer to the policy connector so user policy can |
| 425 // grab a token and register with the policy server. | 428 // grab a token and register with the policy server. |
| 426 // TODO(mnissler): Remove once OAuth is the only authentication mechanism. | 429 // TODO(mnissler): Remove once OAuth is the only authentication mechanism. |
| 427 g_browser_process->browser_policy_connector()->SetUserPolicyTokenService( | 430 connector->SetUserPolicyTokenService( |
| 428 TokenServiceFactory::GetForProfile(profile())); | 431 TokenServiceFactory::GetForProfile(profile())); |
| 429 | 432 |
| 430 // Make sure we flip every profile to not share proxies if the user hasn't | 433 // Make sure we flip every profile to not share proxies if the user hasn't |
| 431 // specified so explicitly. | 434 // specified so explicitly. |
| 432 const PrefService::Preference* use_shared_proxies_pref = | 435 const PrefService::Preference* use_shared_proxies_pref = |
| 433 profile()->GetPrefs()->FindPreference(prefs::kUseSharedProxies); | 436 profile()->GetPrefs()->FindPreference(prefs::kUseSharedProxies); |
| 434 if (use_shared_proxies_pref->IsDefaultValue()) | 437 if (use_shared_proxies_pref->IsDefaultValue()) |
| 435 profile()->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false); | 438 profile()->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false); |
| 436 } | 439 } |
| 437 | 440 |
| 441 // Web trust certificates are only allowed for managed users on managed | |
| 442 // devices of the same domain. | |
| 443 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | |
| 444 const std::string email = user_manager->GetLoggedInUser().email(); | |
| 445 const bool allow_web_trust_from_policy = | |
| 446 !user_manager->IsLoggedInAsGuest() && | |
|
Mattias Nissler (ping if slow)
2012/09/04 09:57:04
I guess we should rather check of regular logins t
Joao da Silva
2012/09/04 12:52:55
Yes, that's more future-proof :-) With the NCU in
| |
| 447 connector->GetUserAffiliation(email) == policy::USER_AFFILIATION_MANAGED; | |
| 438 network_config_updater_.reset( | 448 network_config_updater_.reset( |
| 439 new policy::NetworkConfigurationUpdater( | 449 new policy::NetworkConfigurationUpdater( |
| 440 g_browser_process->policy_service(), | 450 g_browser_process->policy_service(), |
| 441 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); | 451 chromeos::CrosLibrary::Get()->GetNetworkLibrary(), |
| 452 allow_web_trust_from_policy)); | |
| 442 | 453 |
| 443 // Make sure that wallpaper boot transition and other delays in OOBE | 454 // Make sure that wallpaper boot transition and other delays in OOBE |
| 444 // are disabled for tests by default. | 455 // are disabled for tests by default. |
| 445 // Individual tests may enable them if they want. | 456 // Individual tests may enable them if they want. |
| 446 if (parsed_command_line().HasSwitch(switches::kTestType)) | 457 if (parsed_command_line().HasSwitch(switches::kTestType)) |
| 447 chromeos::WizardController::SetZeroDelays(); | 458 chromeos::WizardController::SetZeroDelays(); |
| 448 | 459 |
| 449 // Tests should be able to tune login manager before showing it. | 460 // Tests should be able to tune login manager before showing it. |
| 450 // Thus only show login manager in normal (non-testing) mode. | 461 // Thus only show login manager in normal (non-testing) mode. |
| 451 if (!parameters().ui_task) | 462 if (!parameters().ui_task) |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 611 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; | 622 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; |
| 612 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); | 623 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); |
| 613 } else if (trial->group() == margin_200mb) { | 624 } else if (trial->group() == margin_200mb) { |
| 614 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; | 625 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; |
| 615 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); | 626 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); |
| 616 } else { | 627 } else { |
| 617 LOG(WARNING) << "low_mem: Part of 'default' experiment"; | 628 LOG(WARNING) << "low_mem: Part of 'default' experiment"; |
| 618 } | 629 } |
| 619 } | 630 } |
| 620 } | 631 } |
| OLD | NEW |