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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 13468005: Show only the settings pages for new managed users (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 3f6d37cb49a23f694c2141d321dbdf46e6268f0b..7600026364a8b94c10a3cc86958994e015ee8572 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -924,6 +924,20 @@ void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary(
void StartupBrowserCreatorImpl::AddStartupURLs(
std::vector<GURL>* startup_urls) const {
+ PrefService* prefs = profile_->GetPrefs();
+ bool has_reset_local_passphrase_switch =
+ command_line_.HasSwitch(switches::kResetLocalPassphrase);
+ if ((is_first_run_ || has_reset_local_passphrase_switch) &&
+ prefs->GetBoolean(prefs::kProfileIsManaged)) {
+ startup_urls->insert(startup_urls->begin(),
+ GURL(std::string(chrome::kChromeUISettingsURL) +
+ chrome::kManagedUserSettingsSubPage));
+ if (has_reset_local_passphrase_switch) {
+ prefs->SetString(prefs::kManagedModeLocalPassphrase, "");
+ prefs->SetString(prefs::kManagedModeLocalSalt, "");
+ }
+ }
+
// If we have urls specified by the first run master preferences use them
// and nothing else.
if (browser_creator_ && startup_urls->empty()) {
@@ -953,20 +967,6 @@ void StartupBrowserCreatorImpl::AddStartupURLs(
if (first_run::ShouldShowWelcomePage())
startup_urls->push_back(internals::GetWelcomePageURL());
}
-
- PrefService* prefs = profile_->GetPrefs();
- bool has_reset_local_passphrase_switch =
- command_line_.HasSwitch(switches::kResetLocalPassphrase);
- if ((is_first_run_ || has_reset_local_passphrase_switch) &&
- prefs->GetBoolean(prefs::kProfileIsManaged)) {
- startup_urls->insert(startup_urls->begin(),
- GURL(std::string(chrome::kChromeUISettingsURL) +
- chrome::kManagedUserSettingsSubPage));
- if (has_reset_local_passphrase_switch) {
- prefs->SetString(prefs::kManagedModeLocalPassphrase, "");
- prefs->SetString(prefs::kManagedModeLocalSalt, "");
- }
- }
}
#if !defined(OS_WIN) || defined(USE_AURA)
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_browsertest.cc ('k') | chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698