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

Unified Diff: chrome/browser/ui/webui/options/managed_user_settings_handler.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: 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/webui/options/managed_user_settings_handler.cc
diff --git a/chrome/browser/ui/webui/options/managed_user_settings_handler.cc b/chrome/browser/ui/webui/options/managed_user_settings_handler.cc
index 16c105688c2b354a1e386cf7e8b7270b1897d1b1..4d6dac0970d2b112e6308202ce0e7777e5491efd 100644
--- a/chrome/browser/ui/webui/options/managed_user_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/managed_user_settings_handler.cc
@@ -11,7 +11,6 @@
#include "base/prefs/pref_service.h"
#include "base/time.h"
#include "base/values.h"
-#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/managed_mode/managed_mode_navigation_observer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
@@ -47,15 +46,16 @@ void ManagedUserSettingsHandler::InitializePage() {
return;
}
PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
- base::FundamentalValue is_passphrase_set(!pref_service->GetString(
- prefs::kManagedModeLocalPassphrase).empty());
+ bool passphrase_empty =
+ pref_service->GetString(prefs::kManagedModeLocalPassphrase).empty();
+ base::FundamentalValue is_passphrase_set(!passphrase_empty);
web_ui()->CallJavascriptFunction(
"ManagedUserSettings.passphraseChanged",
is_passphrase_set);
- if ((first_run::IsChromeFirstRun() &&
- !CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoFirstRun)) ||
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kResetLocalPassphrase)) {
+ if (!HasSeenSetupDialog() ||
+ (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kResetLocalPassphrase) &&
+ passphrase_empty)) {
Bernhard Bauer 2013/04/08 12:26:09 Why are we checking for an empty passphrase when k
Adrian Kuegel 2013/04/08 14:31:04 This method is called whenever the settings frame
ManagedModeNavigationObserver::FromWebContents(
web_ui()->GetWebContents())->set_elevated(true);
}
@@ -118,8 +118,15 @@ void ManagedUserSettingsHandler::RegisterMessages() {
base::Unretained(this)));
}
+bool ManagedUserSettingsHandler::HasSeenSetupDialog() {
+ PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
+ return pref_service->GetBoolean(prefs::kManagedModeHasSeenSetupDialog);
+}
+
void ManagedUserSettingsHandler::SaveMetrics(const ListValue* args) {
- if (first_run::IsChromeFirstRun()) {
+ if (!HasSeenSetupDialog()) {
+ PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
+ pref_service->SetBoolean(prefs::kManagedModeHasSeenSetupDialog, true);
UMA_HISTOGRAM_LONG_TIMES("ManagedMode.UserSettingsFirstRunTime",
base::TimeTicks::Now() - start_time_);
} else {

Powered by Google App Engine
This is Rietveld 408576698