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

Unified Diff: chrome/browser/browser_main.cc

Issue 6979011: Move user cloud policy to BrowserProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments by mnissler. 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 fd65ad6a4b855ba0085005dae50e3e86f776a0db..c47dbbca6582faae1b2a5c7d48810edffa5eba47 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"
@@ -795,7 +796,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.
@@ -1582,6 +1583,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