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

Unified Diff: chrome/browser/browser_main.cc

Issue 7147015: Move user cloud policy to BrowserProcess (was 6979011) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit_test include breakage Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/browser_process_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index db448b55d3821e7362d2dab42767443024e46756..a48a3fdd4e75c8ace1179c59b9399df47428506a 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -57,6 +57,7 @@
#include "chrome/browser/net/sdch_dictionary_fetcher.h"
#include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h"
#include "chrome/browser/plugin_updater.h"
+#include "chrome/browser/policy/browser_policy_connector.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/pref_value_store.h"
#include "chrome/browser/prerender/prerender_field_trial.h"
@@ -849,7 +850,7 @@ PrefService* InitializeLocalState(const CommandLine& parsed_command_line,
FilePath parent_profile =
parsed_command_line.GetSwitchValuePath(switches::kParentProfile);
scoped_ptr<PrefService> parent_local_state(
- PrefService::CreatePrefService(parent_profile, NULL, NULL, false));
+ PrefService::CreatePrefService(parent_profile, NULL, false));
parent_local_state->RegisterStringPref(prefs::kApplicationLocale,
std::string());
// Right now, we only inherit the locale setting from the parent profile.
@@ -1646,6 +1647,21 @@ int BrowserMain(const MainFunctionParams& parameters) {
// Post-profile init ---------------------------------------------------------
+#if defined(OS_CHROMEOS)
+ // Handling the user cloud policy initialization for case 2 mentioned above.
+ // We do this after the profile creation since we need the TokenService.
+ if (parsed_command_line.HasSwitch(switches::kLoginUser) &&
+ !parsed_command_line.HasSwitch(switches::kLoginPassword)) {
+ std::string username =
+ parsed_command_line.GetSwitchValueASCII(switches::kLoginUser);
+ policy::BrowserPolicyConnector* browser_policy_connector =
+ g_browser_process->browser_policy_connector();
+ browser_policy_connector->InitializeUserPolicy(username,
+ profile->GetPath(),
+ profile->GetTokenService());
+ }
+#endif
+
PrefService* user_prefs = profile->GetPrefs();
DCHECK(user_prefs);
« no previous file with comments | « no previous file | chrome/browser/browser_process_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698