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

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

Issue 13778004: Start in elevated mode when creating a new managed user profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nit. 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 1d0cff342d18ac9971cb8391f5c1a9191412083b..602299c7ac1ac4b2be1be3e622488681fa1975dd 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -106,6 +106,11 @@
#include "base/win/windows_version.h"
#endif
+#if defined(ENABLE_MANAGED_USERS)
+#include "chrome/browser/managed_mode/managed_user_service.h"
+#include "chrome/browser/managed_mode/managed_user_service_factory.h"
+#endif
+
using content::ChildProcessSecurityPolicy;
using content::WebContents;
using extensions::Extension;
@@ -924,6 +929,7 @@ void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary(
void StartupBrowserCreatorImpl::AddStartupURLs(
std::vector<GURL>* startup_urls) const {
+#if defined(ENABLE_MANAGED_USERS)
PrefService* prefs = profile_->GetPrefs();
bool has_reset_local_passphrase_switch =
command_line_.HasSwitch(switches::kResetLocalPassphrase);
@@ -932,11 +938,15 @@ void StartupBrowserCreatorImpl::AddStartupURLs(
startup_urls->insert(startup_urls->begin(),
GURL(std::string(chrome::kChromeUISettingsURL) +
chrome::kManagedUserSettingsSubPage));
+ ManagedUserService* service = ManagedUserServiceFactory::GetForProfile(
+ profile_);
+ service->set_startup_elevation(true);
if (has_reset_local_passphrase_switch) {
prefs->SetString(prefs::kManagedModeLocalPassphrase, std::string());
prefs->SetString(prefs::kManagedModeLocalSalt, std::string());
}
}
+#endif
// If we have urls specified by the first run master preferences use them
// and nothing else.

Powered by Google App Engine
This is Rietveld 408576698