From e6d1c4f8756e0c8f75314f31ef3d538a0d7ffeca Mon Sep 17 00:00:00 2001 From: "pastarmovj@chromium.org" Date: Wed, 12 Jun 2013 17:37:40 +0000 Subject: Refactor the storage layer out of about_flags. This step is a preparation for moving owner flags storage from local state to signed settings. BUG=221353 TEST=existing about_flags tests still pass. Review URL: https://chromiumcodereview.appspot.com/16542004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205854 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/about_flags.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'chrome/browser/about_flags.h') diff --git a/chrome/browser/about_flags.h b/chrome/browser/about_flags.h index 304fec1..2553425 100644 --- a/chrome/browser/about_flags.h +++ b/chrome/browser/about_flags.h @@ -19,6 +19,8 @@ class ListValue; namespace about_flags { +class FlagsStorage; + // Enumeration of OSs. // This is exposed only for testing. enum { kOsMac = 1 << 0, kOsWin = 1 << 1, kOsLinux = 1 << 2 , kOsCrOS = 1 << 3, @@ -105,7 +107,8 @@ struct Experiment { // Reads the Labs |prefs| (called "Labs" for historical reasons) and adds the // commandline flags belonging to the active experiments to |command_line|. -void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line); +void ConvertFlagsToSwitches(FlagsStorage* flags_storage, + CommandLine* command_line); // Differentiate between generic flags available on a per session base and flags // that influence the whole machine and can be said by the admin only. This flag @@ -116,7 +119,7 @@ enum FlagAccess { kGeneralAccessFlagsOnly, kOwnerAccessToFlags }; // Get the list of experiments. Experiments that are available on the current // platform are appended to |supported_experiments|; all other experiments are // appended to |unsupported_experiments|. -void GetFlagsExperimentsData(PrefService* prefs, +void GetFlagsExperimentsData(FlagsStorage* flags_storage, FlagAccess access, base::ListValue* supported_experiments, base::ListValue* unsupported_experiments); @@ -125,8 +128,9 @@ void GetFlagsExperimentsData(PrefService* prefs, bool IsRestartNeededToCommitChanges(); // Enables or disables the experiment with id |internal_name|. -void SetExperimentEnabled( - PrefService* prefs, const std::string& internal_name, bool enable); +void SetExperimentEnabled(FlagsStorage* flags_storage, + const std::string& internal_name, + bool enable); // Removes all switches that were added to a command line by a previous call to // |ConvertFlagsToSwitches()|. @@ -134,7 +138,7 @@ void RemoveFlagsSwitches( std::map* switch_list); // Reset all flags to the default state by clearing all flags. -void ResetAllFlags(PrefService* prefs); +void ResetAllFlags(FlagsStorage* flags_storage); // Returns the value for the current platform. This is one of the values defined // by the OS enum above. @@ -143,7 +147,7 @@ int GetCurrentPlatform(); // Sends UMA stats about experimental flag usage. This should be called once per // startup. -void RecordUMAStatistics(const PrefService* prefs); +void RecordUMAStatistics(FlagsStorage* flags_storage); namespace testing { -- cgit v1.1