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 b03cc55cf136cfa5bd9bd002393d7feea0bd8cfd..70e4d5c449b627d999bc4c95ba4ceb92b14585ad 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
@@ -759,8 +759,10 @@ Browser* StartupBrowserCreatorImpl::ProcessSpecifiedURLs( |
NOTREACHED() << "SessionStartupPref has deprecated type HOMEPAGE"; |
} |
+ PrefService* prefs = profile_->GetPrefs(); |
if (pref.type != SessionStartupPref::LAST && |
- SyncPromoUI::ShouldShowSyncPromoAtStartup(profile_, is_first_run_)) { |
+ SyncPromoUI::ShouldShowSyncPromoAtStartup(profile_, is_first_run_) && |
Bernhard Bauer
2013/04/03 16:41:23
This method is supposed to tell a caller whether t
Sergiu
2013/04/03 17:45:54
Makes total sense, moved it to sync_promo_ui.cc.
|
+ !prefs->GetBoolean(prefs::kProfileIsManaged)) { |
AddSyncPromoTab(profile_, &tabs); |
} |
@@ -925,6 +927,24 @@ 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, ""); |
+ } else { |
+ // If this is the first run then show only the managed user settings |
Bernhard Bauer
2013/04/03 16:41:23
Wait, is this actually necessary? If we have set a
Sergiu
2013/04/03 17:45:54
That is true, we can do without the else branch. R
|
+ // page. |
+ return; |
+ } |
+ } |
+ |
// If we have urls specified by the first run master preferences use them |
// and nothing else. |
if (browser_creator_ && startup_urls->empty()) { |
@@ -954,20 +974,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) |