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

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: addressed Mattias' comments 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
Index: chrome/browser/browser_main.cc
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 51d2b227a3605ec6e040e811b352c3f90dc427d0..8774cea1b0e463fe26e8c8c73dcbae9a45c7f48d 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"
@@ -794,7 +795,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.
@@ -1577,6 +1578,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') | chrome/browser/policy/browser_policy_connector.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698