Commit 2a1965c1 authored by engedy@chromium.org's avatar engedy@chromium.org

Added the AutomaticProfileResetter service.

BUG=298036
NOTRY=True

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226473 0039d316-1c4b-4281-b951-d872f2087c98
parent 9f92cab2
...@@ -184,6 +184,19 @@ base::DictionaryValue* PrefService::GetPreferenceValues() const { ...@@ -184,6 +184,19 @@ base::DictionaryValue* PrefService::GetPreferenceValues() const {
return out; return out;
} }
base::DictionaryValue* PrefService::GetPreferenceValuesWithoutPathExpansion()
const {
DCHECK(CalledOnValidThread());
base::DictionaryValue* out = new base::DictionaryValue;
PrefRegistry::const_iterator i = pref_registry_->begin();
for (; i != pref_registry_->end(); ++i) {
const base::Value* value = GetPreferenceValue(i->first);
DCHECK(value);
out->SetWithoutPathExpansion(i->first, value->DeepCopy());
}
return out;
}
const PrefService::Preference* PrefService::FindPreference( const PrefService::Preference* PrefService::FindPreference(
const char* pref_name) const { const char* pref_name) const {
DCHECK(CalledOnValidThread()); DCHECK(CalledOnValidThread());
......
...@@ -231,6 +231,16 @@ class BASE_PREFS_EXPORT PrefService : public base::NonThreadSafe { ...@@ -231,6 +231,16 @@ class BASE_PREFS_EXPORT PrefService : public base::NonThreadSafe {
// is passed to the caller. // is passed to the caller.
base::DictionaryValue* GetPreferenceValues() const; base::DictionaryValue* GetPreferenceValues() const;
// Returns a dictionary with effective preference values. Contrary to
// GetPreferenceValues(), the paths of registered preferences are not split on
// '.' characters. If a registered preference stores a dictionary, however,
// the hierarchical structure inside the preference will be preserved.
// For example, if "foo.bar" is a registered preference, the result could look
// like this:
// {"foo.bar": {"a": {"b": true}}}.
// The ownership is passed to the caller.
base::DictionaryValue* GetPreferenceValuesWithoutPathExpansion() const;
bool ReadOnly() const; bool ReadOnly() const;
PrefInitializationStatus GetInitializationStatus() const; PrefInitializationStatus GetInitializationStatus() const;
......
...@@ -386,6 +386,10 @@ ...@@ -386,6 +386,10 @@
</if> </if>
<if expr="pp_ifdef('_google_chrome')"> <if expr="pp_ifdef('_google_chrome')">
<include name="IDR_PREF_HASH_SEED_BIN" file="resources\settings_internal\pref_hash_seed.bin" type="BINDATA" /> <include name="IDR_PREF_HASH_SEED_BIN" file="resources\settings_internal\pref_hash_seed.bin" type="BINDATA" />
<include name="IDR_AUTOMATIC_PROFILE_RESET_RULES" file="internal\resources\profile_reset\automatic_profile_reset_rules.dat" type="BINDATA" />
<include name="IDR_AUTOMATIC_PROFILE_RESET_RULES_DRY" file="internal\resources\profile_reset\automatic_profile_reset_rules_dry.dat" type="BINDATA" />
<include name="IDR_AUTOMATIC_PROFILE_RESET_HASH_SEED" file="internal\resources\profile_reset\automatic_profile_reset_hash_seed.dat" type="BINDATA" />
<include name="IDR_AUTOMATIC_PROFILE_RESET_HASH_SEED_DRY" file="internal\resources\profile_reset\automatic_profile_reset_hash_seed_dry.dat" type="BINDATA" />
</if> </if>
<if expr="pp_ifdef('chromeos')"> <if expr="pp_ifdef('chromeos')">
<include name="IDR_SOUND_STARTUP_WAV" file="resources\chromeos\sounds\startup.wav" type="BINDATA" /> <include name="IDR_SOUND_STARTUP_WAV" file="resources\chromeos\sounds\startup.wav" type="BINDATA" />
......
...@@ -172,6 +172,7 @@ ...@@ -172,6 +172,7 @@
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include "chrome/browser/ui/webui/ntp/android/promo_handler.h" #include "chrome/browser/ui/webui/ntp/android/promo_handler.h"
#else #else
#include "chrome/browser/profile_resetter/automatic_profile_resetter_factory.h"
#include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h"
#endif #endif
...@@ -268,6 +269,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) { ...@@ -268,6 +269,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#endif #endif
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
AutomaticProfileResetterFactory::RegisterPrefs(registry);
BackgroundModeManager::RegisterPrefs(registry); BackgroundModeManager::RegisterPrefs(registry);
RegisterBrowserPrefs(registry); RegisterBrowserPrefs(registry);
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS)
......
This diff is collapsed.
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_H_
#define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_piece.h"
#include "base/values.h"
#include "chrome/browser/profile_resetter/automatic_profile_resetter_mementos.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
class Profile;
// Defines the interface for the delegate that will actually show the prompt
// and/or report statistics on behalf of the AutomaticProfileResetter.
// The primary reason for this separation is to facilitate unit testing.
class AutomaticProfileResetterDelegate {
public:
virtual ~AutomaticProfileResetterDelegate() {}
// Triggers showing the one-time profile settings reset prompt.
virtual void ShowPrompt() = 0;
// Reports the given metrics through UMA.
virtual void ReportStatistics(uint32 satisfied_criteria_mask,
uint32 combined_status_mask) = 0;
};
// This service becomes busy shortly after start-up, and is responsible for
// evaluating if the criteria for showing the one-time profile reset prompt
// are satisfied, and will potentially trigger the prompt, but only a single
// time during the lifetime of a profile on disk (this is achieved by storing
// "mementos"). All methods in this class shall be called on the UI thread.
class AutomaticProfileResetter : public BrowserContextKeyedService {
public:
explicit AutomaticProfileResetter(Profile* profile);
virtual ~AutomaticProfileResetter();
// Initializes the service, and sets up the asynchronous evaluation flow.
// Called by AutomaticProfileResetterFactory.
void Initialize();
// Should be called after Initialize().
void SetHashSeedForTesting(const base::StringPiece& hash_seed);
// Should be called after Initialize().
void SetProgramForTesting(const base::StringPiece& program);
// Should be called after Initialize(). Takes ownership.
void SetDelegateForTesting(AutomaticProfileResetterDelegate* delegate);
private:
struct EvaluationResults;
enum State {
STATE_UNINITIALIZED,
STATE_DISABLED,
STATE_READY,
STATE_WORKING,
STATE_DONE
};
// Returns whether or not a dry-run shall be performed.
bool ShouldPerformDryRun() const;
// Returns whether or not a live-run shall be performed.
bool ShouldPerformLiveRun() const;
// Begins the asynchronous evaluation flow, which will assess whether the
// criteria for showing the reset prompt are met, whether we have already
// shown the prompt, and, in the end, will potentially trigger the prompt.
void BeginEvaluationFlow();
// Called back by |memento_in_file_| once it has finished reading the value of
// the file-based memento. Continues the evaluation flow with collecting state
// information and assembling it as the input for the evaluator program.
void ContinueWithEvaluationFlow(const std::string& memento_value_in_file);
// Prepare the input of the evaluator program. This will contain all the state
// information required to assess whether or not the conditions for showing
// the reset prompt are met.
scoped_ptr<base::DictionaryValue> BuildEvaluatorProgramInput(
const std::string& memento_value_in_file);
// Performs the bulk of the work. Invokes the interpreter to run the |program|
// that will evaluate whether the conditions are met for showing the reset
// prompt. The program will make this decision based on the state information
// contained in |input| in the form of key-value pairs. The program will only
// see hashed keys and values that are produced using |hash_seed| as a key.
static scoped_ptr<EvaluationResults> EvaluateConditionsOnWorkerPoolThread(
const base::StringPiece& hash_seed,
const base::StringPiece& program,
scoped_ptr<base::DictionaryValue> program_input);
// Called back when EvaluateConditionsOnWorkerPoolThread completes executing
// the program with |results|. Finishes the evaluation flow, and, based on the
// result, will potentially show the reset prompt.
void FinishEvaluationFlow(scoped_ptr<EvaluationResults> results);
// BrowserContextKeyedService overrides:
virtual void Shutdown() OVERRIDE;
Profile* profile_;
State state_;
base::StringPiece hash_seed_;
base::StringPiece program_;
PreferenceHostedPromptMemento memento_in_prefs_;
LocalStateHostedPromptMemento memento_in_local_state_;
FileHostedPromptMemento memento_in_file_;
scoped_ptr<AutomaticProfileResetterDelegate> delegate_;
base::WeakPtrFactory<AutomaticProfileResetter> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetter);
};
#endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_H_
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/profile_resetter/automatic_profile_resetter_factory.h"
#include "base/memory/singleton.h"
#include "base/prefs/pref_registry_simple.h"
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/google/google_url_tracker_factory.h"
#include "chrome/browser/profile_resetter/automatic_profile_resetter.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
#include "chrome/common/pref_names.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/browser_context.h"
// static
AutomaticProfileResetter* AutomaticProfileResetterFactory::GetForBrowserContext(
content::BrowserContext* context) {
return static_cast<AutomaticProfileResetter*>(
GetInstance()->GetServiceForBrowserContext(context, true));
}
// static
AutomaticProfileResetterFactory*
AutomaticProfileResetterFactory::GetInstance() {
return Singleton<AutomaticProfileResetterFactory>::get();
}
// static
void AutomaticProfileResetterFactory::RegisterPrefs(
PrefRegistrySimple* registry) {
registry->RegisterDictionaryPref(prefs::kProfileResetPromptMemento);
}
AutomaticProfileResetterFactory::AutomaticProfileResetterFactory()
: BrowserContextKeyedServiceFactory(
"AutomaticProfileResetter",
BrowserContextDependencyManager::GetInstance()) {}
AutomaticProfileResetterFactory::~AutomaticProfileResetterFactory() {}
BrowserContextKeyedService*
AutomaticProfileResetterFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
Profile* profile = Profile::FromBrowserContext(context);
AutomaticProfileResetter* service = new AutomaticProfileResetter(profile);
service->Initialize();
return service;
}
void AutomaticProfileResetterFactory::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterStringPref(
prefs::kProfileResetPromptMemento,
"",
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
bool AutomaticProfileResetterFactory::ServiceIsCreatedWithBrowserContext()
const {
return true;
}
bool AutomaticProfileResetterFactory::ServiceIsNULLWhileTesting() const {
return true;
}
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_
#define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_
#include "base/basictypes.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
template <typename T>
struct DefaultSingletonTraits;
class PrefRegistrySimple;
namespace content {
class BrowserContext;
}
namespace user_prefs {
class PrefRegistrySyncable;
}
class AutomaticProfileResetter;
class AutomaticProfileResetterFactory
: public BrowserContextKeyedServiceFactory {
public:
static AutomaticProfileResetter* GetForBrowserContext(
content::BrowserContext* context);
static AutomaticProfileResetterFactory* GetInstance();
// Registers Local State preferences.
static void RegisterPrefs(PrefRegistrySimple* registry);
private:
friend struct DefaultSingletonTraits<AutomaticProfileResetterFactory>;
AutomaticProfileResetterFactory();
virtual ~AutomaticProfileResetterFactory();
// BrowserContextKeyedServiceFactory overrides:
virtual BrowserContextKeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const OVERRIDE;
// BrowserContextKeyedBaseFactory overrides:
virtual void RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) OVERRIDE;
virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetterFactory);
};
#endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/profile_resetter/automatic_profile_resetter_mementos.h"
#include "base/bind_helpers.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/prefs/pref_service.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
using base::DictionaryValue;
// AutomaticProfileResetter::PreferenceHostedPromptMemento -------------------
PreferenceHostedPromptMemento::PreferenceHostedPromptMemento(Profile* profile)
: profile_(profile) {}
PreferenceHostedPromptMemento::~PreferenceHostedPromptMemento() {}
std::string PreferenceHostedPromptMemento::ReadValue() const {
PrefService* prefs = profile_->GetPrefs();
DCHECK(prefs);
return prefs->GetString(prefs::kProfileResetPromptMemento);
}
void PreferenceHostedPromptMemento::StoreValue(const std::string& value) {
PrefService* prefs = profile_->GetPrefs();
DCHECK(prefs);
prefs->SetString(prefs::kProfileResetPromptMemento, value);
}
// AutomaticProfileResetter::LocalStateHostedPromptMemento -------------------
LocalStateHostedPromptMemento::LocalStateHostedPromptMemento(Profile* profile)
: profile_(profile) {}
LocalStateHostedPromptMemento::~LocalStateHostedPromptMemento() {}
std::string LocalStateHostedPromptMemento::ReadValue() const {
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
const DictionaryValue* prompt_shown_dict =
local_state->GetDictionary(prefs::kProfileResetPromptMemento);
std::string profile_key = GetProfileKey();
if (!prompt_shown_dict || profile_key.empty()) {
NOTREACHED();
return "";
}
std::string value;
return prompt_shown_dict->GetStringWithoutPathExpansion(profile_key, &value)
? value
: "";
}
void LocalStateHostedPromptMemento::StoreValue(const std::string& value) {
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
DictionaryPrefUpdate prompt_shown_dict_update(
local_state, prefs::kProfileResetPromptMemento);
std::string profile_key = GetProfileKey();
if (profile_key.empty()) {
NOTREACHED();
return;
}
prompt_shown_dict_update.Get()->SetStringWithoutPathExpansion(profile_key,
value);
}
std::string LocalStateHostedPromptMemento::GetProfileKey() const {
return profile_->GetPath().BaseName().MaybeAsASCII();
}
// AutomaticProfileResetter::FileHostedPromptMemento -------------------------
FileHostedPromptMemento::FileHostedPromptMemento(Profile* profile)
: profile_(profile) {}
FileHostedPromptMemento::~FileHostedPromptMemento() {}
void FileHostedPromptMemento::ReadValue(
const ReadValueCallback& callback) const {
base::FilePath path = GetMementoFilePath();
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::FILE,
FROM_HERE,
base::Bind(&ReadValueOnFileThread, path),
callback);
}
void FileHostedPromptMemento::StoreValue(const std::string& value) {
base::FilePath path = GetMementoFilePath();
content::BrowserThread::PostTask(
content::BrowserThread::FILE,
FROM_HERE,
base::Bind(&StoreValueOnFileThread, path, value));
}
std::string FileHostedPromptMemento::ReadValueOnFileThread(
const base::FilePath& memento_file_path) {
std::string value;
base::ReadFileToString(memento_file_path, &value);
return value;
}
void FileHostedPromptMemento::StoreValueOnFileThread(
const base::FilePath& memento_file_path,
const std::string& value) {
int retval =
file_util::WriteFile(memento_file_path, value.c_str(), value.size());
DCHECK_EQ(retval, (int)value.size());
}
base::FilePath FileHostedPromptMemento::GetMementoFilePath() const {
return profile_->GetPath().Append(chrome::kResetPromptMementoFilename);
}
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The classes in this file are alternative implementations of the concept of a
// "prompt memento", a token of some kind that gets stored when we show the
// one-time profile reset prompt, and which then serves as a reminder that we
// should not show the prompt again.
//
// In an ideal world, a single implementation would suffice, however, we expect
// that third party software might accidentally interfere with some of these
// methods. We need this redundancy because we want to make absolutely sure that
// we do not annoy the user with the prompt multiple times.
#ifndef CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_MEMENTOS_H_
#define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_MEMENTOS_H_
#include <string>
#include "base/basictypes.h"
#include "base/callback.h"
namespace base {
class FilePath;
}
class Profile;
// This class is a wrapper around the user preference that gets stored when we
// show the one-time profile reset prompt, and which is kept as a reminder that
// we should not show the prompt again.
class PreferenceHostedPromptMemento {
public:
explicit PreferenceHostedPromptMemento(Profile* profile);
~PreferenceHostedPromptMemento();
std::string ReadValue() const;
void StoreValue(const std::string& value);
private:
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(PreferenceHostedPromptMemento);
};
// This class is a wrapper around the Local State preference that gets stored
// when we show the one-time profile reset prompt, and which is kept as a
// reminder that we should not show the prompt again.
class LocalStateHostedPromptMemento {
public:
explicit LocalStateHostedPromptMemento(Profile* profile);
~LocalStateHostedPromptMemento();
std::string ReadValue() const;
void StoreValue(const std::string& value);
private:
// Returns the key that shall be used in the dictionary preference in Local
// State to uniquely identify this profile.
std::string GetProfileKey() const;
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(LocalStateHostedPromptMemento);
};
// This class manages a marker file that gets stored when we show the one-time
// profile reset prompt, and which is kept as a reminder that we should not show
// the prompt again.
class FileHostedPromptMemento {
public:
typedef base::Callback<void(const std::string&)> ReadValueCallback;
explicit FileHostedPromptMemento(Profile* profile);
~FileHostedPromptMemento();
// Posts to the FILE thread to read the value, then returns the value to the
// calling thread.
void ReadValue(const ReadValueCallback& callback) const;
// Asynchronously stores the value on the FILE thread.
void StoreValue(const std::string& value);
private:
static std::string ReadValueOnFileThread(
const base::FilePath& memento_file_path);
static void StoreValueOnFileThread(const base::FilePath& memento_file_path,
const std::string& value);
// Returns the path to the file that shall be used to store this kind of
// memento for this profile.
base::FilePath GetMementoFilePath() const;
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(FileHostedPromptMemento);
};
#endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_MEMENTOS_H_
...@@ -19,6 +19,7 @@ class JtlInterpreter { ...@@ -19,6 +19,7 @@ class JtlInterpreter {
OK, OK,
PARSE_ERROR, PARSE_ERROR,
RUNTIME_ERROR, RUNTIME_ERROR,
RESULT_MAX,
}; };
// |hasher_seed| is a value used in jtl_foundation::Hasher. All node names, // |hasher_seed| is a value used in jtl_foundation::Hasher. All node names,
......
...@@ -139,6 +139,7 @@ ...@@ -139,6 +139,7 @@
#else #else
#include "chrome/browser/media_galleries/media_galleries_preferences_factory.h" #include "chrome/browser/media_galleries/media_galleries_preferences_factory.h"
#include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h" #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h"
#include "chrome/browser/profile_resetter/automatic_profile_resetter_factory.h"
#endif #endif
#if defined(ENABLE_SPELLCHECK) #if defined(ENABLE_SPELLCHECK)
...@@ -179,6 +180,9 @@ void ChromeBrowserMainExtraPartsProfiles:: ...@@ -179,6 +180,9 @@ void ChromeBrowserMainExtraPartsProfiles::
EnsureBrowserContextKeyedServiceFactoriesBuilt() { EnsureBrowserContextKeyedServiceFactoriesBuilt() {
AboutSigninInternalsFactory::GetInstance(); AboutSigninInternalsFactory::GetInstance();
autofill::PersonalDataManagerFactory::GetInstance(); autofill::PersonalDataManagerFactory::GetInstance();
#if !defined(OS_ANDROID)
AutomaticProfileResetterFactory::GetInstance();
#endif
#if defined(ENABLE_BACKGROUND) #if defined(ENABLE_BACKGROUND)
BackgroundContentsServiceFactory::GetInstance(); BackgroundContentsServiceFactory::GetInstance();
#endif #endif
......
...@@ -1700,6 +1700,12 @@ ...@@ -1700,6 +1700,12 @@
'browser/process_singleton_startup_lock.cc', 'browser/process_singleton_startup_lock.cc',
'browser/process_singleton_startup_lock.h', 'browser/process_singleton_startup_lock.h',
'browser/process_singleton_win.cc', 'browser/process_singleton_win.cc',
'browser/profile_resetter/automatic_profile_resetter.h',
'browser/profile_resetter/automatic_profile_resetter.cc',
'browser/profile_resetter/automatic_profile_resetter_factory.h',
'browser/profile_resetter/automatic_profile_resetter_factory.cc',
'browser/profile_resetter/automatic_profile_resetter_mementos.h',
'browser/profile_resetter/automatic_profile_resetter_mementos.cc',
'browser/profile_resetter/brandcoded_default_settings.h', 'browser/profile_resetter/brandcoded_default_settings.h',
'browser/profile_resetter/brandcoded_default_settings.cc', 'browser/profile_resetter/brandcoded_default_settings.cc',
'browser/profile_resetter/brandcode_config_fetcher.h', 'browser/profile_resetter/brandcode_config_fetcher.h',
...@@ -3277,6 +3283,7 @@ ...@@ -3277,6 +3283,7 @@
['exclude', '^browser/importer/'], ['exclude', '^browser/importer/'],
['exclude', '^browser/media_galleries/'], ['exclude', '^browser/media_galleries/'],
['exclude', '^browser/net/firefox_*'], ['exclude', '^browser/net/firefox_*'],
['exclude', '^browser/profile_resetter/'],
['exclude', '^browser/service/'], ['exclude', '^browser/service/'],
['exclude', '^browser/sync/glue/app_'], ['exclude', '^browser/sync/glue/app_'],
['exclude', '^browser/sync/glue/extension_'], ['exclude', '^browser/sync/glue/extension_'],
......
...@@ -1123,6 +1123,7 @@ ...@@ -1123,6 +1123,7 @@
'browser/process_info_snapshot_mac_unittest.cc', 'browser/process_info_snapshot_mac_unittest.cc',
'browser/process_singleton_linux_unittest.cc', 'browser/process_singleton_linux_unittest.cc',
'browser/process_singleton_mac_unittest.cc', 'browser/process_singleton_mac_unittest.cc',
'browser/profile_resetter/automatic_profile_resetter_unittest.cc',
'browser/profile_resetter/jtl_interpreter_unittest.cc', 'browser/profile_resetter/jtl_interpreter_unittest.cc',
'browser/profile_resetter/profile_resetter_unittest.cc', 'browser/profile_resetter/profile_resetter_unittest.cc',
'browser/profiles/file_path_verifier_win_unittest.cc', 'browser/profiles/file_path_verifier_win_unittest.cc',
......
...@@ -177,6 +177,8 @@ const base::FilePath::CharType kNewTabThumbnailsFilename[] = ...@@ -177,6 +177,8 @@ const base::FilePath::CharType kNewTabThumbnailsFilename[] =
const base::FilePath::CharType kOBCertFilename[] = FPL("Origin Bound Certs"); const base::FilePath::CharType kOBCertFilename[] = FPL("Origin Bound Certs");
const base::FilePath::CharType kPreferencesFilename[] = FPL("Preferences"); const base::FilePath::CharType kPreferencesFilename[] = FPL("Preferences");
const base::FilePath::CharType kReadmeFilename[] = FPL("README"); const base::FilePath::CharType kReadmeFilename[] = FPL("README");
const base::FilePath::CharType kResetPromptMementoFilename[] =
FPL("Reset Prompt Memento");
const base::FilePath::CharType kSafeBrowsingBaseFilename[] = const base::FilePath::CharType kSafeBrowsingBaseFilename[] =
FPL("Safe Browsing"); FPL("Safe Browsing");
const base::FilePath::CharType kServiceStateFileName[] = FPL("Service State"); const base::FilePath::CharType kServiceStateFileName[] = FPL("Service State");
......
...@@ -72,6 +72,7 @@ extern const base::FilePath::CharType kNewTabThumbnailsFilename[]; ...@@ -72,6 +72,7 @@ extern const base::FilePath::CharType kNewTabThumbnailsFilename[];
extern const base::FilePath::CharType kOBCertFilename[]; extern const base::FilePath::CharType kOBCertFilename[];
extern const base::FilePath::CharType kPreferencesFilename[]; extern const base::FilePath::CharType kPreferencesFilename[];
extern const base::FilePath::CharType kReadmeFilename[]; extern const base::FilePath::CharType kReadmeFilename[];
extern const base::FilePath::CharType kResetPromptMementoFilename[];
extern const base::FilePath::CharType kSafeBrowsingBaseFilename[]; extern const base::FilePath::CharType kSafeBrowsingBaseFilename[];
extern const base::FilePath::CharType kServiceStateFileName[]; extern const base::FilePath::CharType kServiceStateFileName[];
extern const base::FilePath::CharType kShortcutsDatabaseName[]; extern const base::FilePath::CharType kShortcutsDatabaseName[];
......
...@@ -1259,6 +1259,11 @@ extern const char kFullscreenAllowed[] = "fullscreen.allowed"; ...@@ -1259,6 +1259,11 @@ extern const char kFullscreenAllowed[] = "fullscreen.allowed";
const char kLocalDiscoveryNotificationsEnabled[] = const char kLocalDiscoveryNotificationsEnabled[] =
"local_discovery.notifications_enabled"; "local_discovery.notifications_enabled";
// String that indicates if the Profile Reset prompt has already been shown to
// the user. Used both in user preferences and local state, in the latter, it is
// actually a dictionary that maps profile keys to before-mentioned strings.
const char kProfileResetPromptMemento[] = "profile.reset_prompt_memento";
// *************** LOCAL STATE *************** // *************** LOCAL STATE ***************
// These are attached to the machine/installation // These are attached to the machine/installation
......
...@@ -417,6 +417,8 @@ extern const char kFullscreenAllowed[]; ...@@ -417,6 +417,8 @@ extern const char kFullscreenAllowed[];
extern const char kLocalDiscoveryNotificationsEnabled[]; extern const char kLocalDiscoveryNotificationsEnabled[];
extern const char kProfileResetPromptMemento[];
// Local state prefs. Please add Profile prefs above instead. // Local state prefs. Please add Profile prefs above instead.
extern const char kCertRevocationCheckingEnabled[]; extern const char kCertRevocationCheckingEnabled[];
extern const char kCertRevocationCheckingRequiredLocalAnchors[]; extern const char kCertRevocationCheckingRequiredLocalAnchors[];
......
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