Move kEulaAccepted pref name to chrome/common/pref_names.h.

This pref will also be used by Chrome on Android and iOS,
in addition to ChromeOS.

BUG=226757

Review URL: https://codereview.chromium.org/14066011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194587 0039d316-1c4b-4281-b951-d872f2087c98
parent 985429d1
...@@ -67,9 +67,6 @@ using content::BrowserThread; ...@@ -67,9 +67,6 @@ using content::BrowserThread;
namespace { namespace {
// A boolean pref of the EULA accepted flag.
const char kEulaAccepted[] = "EulaAccepted";
// A string pref with initial locale set in VPD or manifest. // A string pref with initial locale set in VPD or manifest.
const char kInitialLocale[] = "intl.initial_locale"; const char kInitialLocale[] = "intl.initial_locale";
...@@ -424,7 +421,7 @@ void WizardController::SkipUpdateEnrollAfterEula() { ...@@ -424,7 +421,7 @@ void WizardController::SkipUpdateEnrollAfterEula() {
void WizardController::RegisterPrefs(PrefRegistrySimple* registry) { void WizardController::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(kOobeComplete, false); registry->RegisterBooleanPref(kOobeComplete, false);
registry->RegisterIntegerPref(kDeviceRegistered, -1); registry->RegisterIntegerPref(kDeviceRegistered, -1);
registry->RegisterBooleanPref(kEulaAccepted, false); registry->RegisterBooleanPref(prefs::kEulaAccepted, false);
registry->RegisterStringPref(kInitialLocale, "en-US"); registry->RegisterStringPref(kInitialLocale, "en-US");
} }
...@@ -701,7 +698,7 @@ void WizardController::AdvanceToScreen(const std::string& screen_name) { ...@@ -701,7 +698,7 @@ void WizardController::AdvanceToScreen(const std::string& screen_name) {
// static // static
bool WizardController::IsEulaAccepted() { bool WizardController::IsEulaAccepted() {
return g_browser_process->local_state()->GetBoolean(kEulaAccepted); return g_browser_process->local_state()->GetBoolean(prefs::kEulaAccepted);
} }
// static // static
...@@ -711,7 +708,7 @@ bool WizardController::IsOobeCompleted() { ...@@ -711,7 +708,7 @@ bool WizardController::IsOobeCompleted() {
// static // static
void WizardController::MarkEulaAccepted() { void WizardController::MarkEulaAccepted() {
SaveBoolPreferenceForced(kEulaAccepted, true); SaveBoolPreferenceForced(prefs::kEulaAccepted, true);
} }
// static // static
......
...@@ -7,12 +7,7 @@ ...@@ -7,12 +7,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/common/pref_names.h"
namespace {
const char kEulaAccepted[] = "EulaAccepted";
} // namespace
EulaAcceptedNotifierMobile::EulaAcceptedNotifierMobile( EulaAcceptedNotifierMobile::EulaAcceptedNotifierMobile(
PrefService* local_state) PrefService* local_state)
...@@ -23,13 +18,13 @@ EulaAcceptedNotifierMobile::~EulaAcceptedNotifierMobile() { ...@@ -23,13 +18,13 @@ EulaAcceptedNotifierMobile::~EulaAcceptedNotifierMobile() {
} }
bool EulaAcceptedNotifierMobile::IsEulaAccepted() { bool EulaAcceptedNotifierMobile::IsEulaAccepted() {
if (local_state_->GetBoolean(kEulaAccepted)) if (local_state_->GetBoolean(prefs::kEulaAccepted))
return true; return true;
// Register for the notification, if this is the first time. // Register for the notification, if this is the first time.
if (registrar_.IsEmpty()) { if (registrar_.IsEmpty()) {
registrar_.Init(local_state_); registrar_.Init(local_state_);
registrar_.Add(kEulaAccepted, registrar_.Add(prefs::kEulaAccepted,
base::Bind(&EulaAcceptedNotifierMobile::OnPrefChanged, base::Bind(&EulaAcceptedNotifierMobile::OnPrefChanged,
base::Unretained(this))); base::Unretained(this)));
} }
...@@ -40,7 +35,7 @@ void EulaAcceptedNotifierMobile::OnPrefChanged() { ...@@ -40,7 +35,7 @@ void EulaAcceptedNotifierMobile::OnPrefChanged() {
DCHECK(!registrar_.IsEmpty()); DCHECK(!registrar_.IsEmpty());
registrar_.RemoveAll(); registrar_.RemoveAll();
DCHECK(local_state_->GetBoolean(kEulaAccepted)); DCHECK(local_state_->GetBoolean(prefs::kEulaAccepted));
NotifyObserver(); NotifyObserver();
} }
...@@ -50,7 +45,7 @@ EulaAcceptedNotifier* EulaAcceptedNotifier::Create() { ...@@ -50,7 +45,7 @@ EulaAcceptedNotifier* EulaAcceptedNotifier::Create() {
// If the |kEulaAccepted| pref is not registered, return NULL which is // If the |kEulaAccepted| pref is not registered, return NULL which is
// equivalent to not needing to check the EULA. This is the case for some // equivalent to not needing to check the EULA. This is the case for some
// tests for higher-level classes that use the EulaAcceptNotifier. // tests for higher-level classes that use the EulaAcceptNotifier.
if (local_state->FindPreference(kEulaAccepted) == NULL) if (local_state->FindPreference(prefs::kEulaAccepted) == NULL)
return NULL; return NULL;
return new EulaAcceptedNotifierMobile(local_state); return new EulaAcceptedNotifierMobile(local_state);
} }
...@@ -1237,6 +1237,9 @@ const char kCipherSuiteBlacklist[] = "ssl.cipher_suites.blacklist"; ...@@ -1237,6 +1237,9 @@ const char kCipherSuiteBlacklist[] = "ssl.cipher_suites.blacklist";
const char kEnableOriginBoundCerts[] = "ssl.origin_bound_certs.enabled"; const char kEnableOriginBoundCerts[] = "ssl.origin_bound_certs.enabled";
const char kDisableSSLRecordSplitting[] = "ssl.ssl_record_splitting.disabled"; const char kDisableSSLRecordSplitting[] = "ssl.ssl_record_splitting.disabled";
// A boolean pref of the EULA accepted flag.
const char kEulaAccepted[] = "EulaAccepted";
// The metrics client GUID, entropy source and session ID. // The metrics client GUID, entropy source and session ID.
const char kMetricsClientID[] = "user_experience_metrics.client_id"; const char kMetricsClientID[] = "user_experience_metrics.client_id";
const char kMetricsSessionID[] = "user_experience_metrics.session_id"; const char kMetricsSessionID[] = "user_experience_metrics.session_id";
......
...@@ -435,6 +435,8 @@ extern const char kGLVendorString[]; ...@@ -435,6 +435,8 @@ extern const char kGLVendorString[];
extern const char kGLRendererString[]; extern const char kGLRendererString[];
extern const char kGLVersionString[]; extern const char kGLVersionString[];
extern const char kEulaAccepted[];
extern const char kMetricsClientID[]; extern const char kMetricsClientID[];
extern const char kMetricsSessionID[]; extern const char kMetricsSessionID[];
extern const char kMetricsLowEntropySource[]; extern const char kMetricsLowEntropySource[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment