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

Side by Side Diff: chrome/browser/about_flags.h

Issue 13467023: Add differentiation between owner only and common flags on ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make the owner param an enum. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/about_flags.cc » ('j') | chrome/browser/about_flags.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ABOUT_FLAGS_H_ 5 #ifndef CHROME_BROWSER_ABOUT_FLAGS_H_
6 #define CHROME_BROWSER_ABOUT_FLAGS_H_ 6 #define CHROME_BROWSER_ABOUT_FLAGS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 13
14 class PrefService; 14 class PrefService;
15 15
16 namespace base { 16 namespace base {
17 class ListValue; 17 class ListValue;
18 } 18 }
19 19
20 namespace about_flags { 20 namespace about_flags {
21 21
22 // Enumeration of OSs. 22 // Enumeration of OSs.
23 // This is exposed only for testing. 23 // This is exposed only for testing.
24 enum { kOsMac = 1 << 0, kOsWin = 1 << 1, kOsLinux = 1 << 2 , kOsCrOS = 1 << 3, 24 enum { kOsMac = 1 << 0, kOsWin = 1 << 1, kOsLinux = 1 << 2 , kOsCrOS = 1 << 3,
25 kOsAndroid = 1 << 4 }; 25 kOsAndroid = 1 << 4, kOsCrOSOwnerOnly = 1 << 5 };
26
27 // Differentiate between generic flags available on a per session base and flags
28 // that influence the whole machine and can be said by the admin only. This flag
29 // is relevant for ChromeOS for now only and dictates whether entries marked
30 // with the |kOsCrOSOwnerOnly| label should be enabled in the UI or not.
31 enum FlagAccess { kGeneralAccessFlagsOnly, kOwnerAccessToFlags };
26 32
27 // Experiment is used internally by about_flags to describe an experiment (and 33 // Experiment is used internally by about_flags to describe an experiment (and
28 // for testing). 34 // for testing).
29 // This is exposed only for testing. 35 // This is exposed only for testing.
30 struct Experiment { 36 struct Experiment {
31 enum Type { 37 enum Type {
32 // An experiment with a single value. This is typically what you want. 38 // An experiment with a single value. This is typically what you want.
33 SINGLE_VALUE, 39 SINGLE_VALUE,
34 40
35 // The experiment has multiple values only one of which is ever enabled. 41 // The experiment has multiple values only one of which is ever enabled.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Returns the name used in prefs for the choice at the specified |index|. 105 // Returns the name used in prefs for the choice at the specified |index|.
100 std::string NameForChoice(int index) const; 106 std::string NameForChoice(int index) const;
101 107
102 // Returns the human readable description for the choice at |index|. 108 // Returns the human readable description for the choice at |index|.
103 string16 DescriptionForChoice(int index) const; 109 string16 DescriptionForChoice(int index) const;
104 }; 110 };
105 111
106 // Reads the Labs |prefs| (called "Labs" for historical reasons) and adds the 112 // Reads the Labs |prefs| (called "Labs" for historical reasons) and adds the
107 // commandline flags belonging to the active experiments to |command_line|. 113 // commandline flags belonging to the active experiments to |command_line|.
108 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line); 114 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
109 115
Nico 2013/04/16 21:40:24 nit: I'd move the enum right above this function,
pastarmovj 2013/04/17 16:03:22 Done.
110 // Get a list of all available experiments. The caller owns the result. 116 // Get a list of all available experiments. The caller owns the result.
111 base::ListValue* GetFlagsExperimentsData(PrefService* prefs); 117 base::ListValue* GetFlagsExperimentsData(PrefService* prefs, FlagAccess access);
112 118
113 // Returns true if one of the experiment flags has been flipped since startup. 119 // Returns true if one of the experiment flags has been flipped since startup.
114 bool IsRestartNeededToCommitChanges(); 120 bool IsRestartNeededToCommitChanges();
115 121
116 // Enables or disables the experiment with id |internal_name|. 122 // Enables or disables the experiment with id |internal_name|.
117 void SetExperimentEnabled( 123 void SetExperimentEnabled(
118 PrefService* prefs, const std::string& internal_name, bool enable); 124 PrefService* prefs, const std::string& internal_name, bool enable);
119 125
120 // Removes all switches that were added to a command line by a previous call to 126 // Removes all switches that were added to a command line by a previous call to
121 // |ConvertFlagsToSwitches()|. 127 // |ConvertFlagsToSwitches()|.
(...skipping 26 matching lines...) Expand all
148 154
149 // Separator used for multi values. Multi values are represented in prefs as 155 // Separator used for multi values. Multi values are represented in prefs as
150 // name-of-experiment + kMultiSeparator + selected_index. 156 // name-of-experiment + kMultiSeparator + selected_index.
151 extern const char kMultiSeparator[]; 157 extern const char kMultiSeparator[];
152 158
153 } // namespace testing 159 } // namespace testing
154 160
155 } // namespace about_flags 161 } // namespace about_flags
156 162
157 #endif // CHROME_BROWSER_ABOUT_FLAGS_H_ 163 #endif // CHROME_BROWSER_ABOUT_FLAGS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/about_flags.cc » ('j') | chrome/browser/about_flags.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698