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

Side by Side Diff: chrome/installer/util/master_preferences.h

Issue 3117017: Remove deprecated wstring Get(As)String() methods from Value, etc. (Closed)
Patch Set: fix win Created 10 years, 4 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
« no previous file with comments | « chrome/common/plugin_group_unittest.cc ('k') | chrome/installer/util/master_preferences.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This file contains functions processing master preference file used by 5 // This file contains functions processing master preference file used by
6 // setup and first run. 6 // setup and first run.
7 7
8 #ifndef CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_ 8 #ifndef CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_
9 #define CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_ 9 #define CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_
10 #pragma once 10 #pragma once
11 11
(...skipping 13 matching lines...) Expand all
25 25
26 // Parse command line and read master preferences, if present, to get 26 // Parse command line and read master preferences, if present, to get
27 // distribution related install options. Merge them if any command line 27 // distribution related install options. Merge them if any command line
28 // options present (command line value takes precedence). 28 // options present (command line value takes precedence).
29 DictionaryValue* GetInstallPreferences(const CommandLine& cmd_line); 29 DictionaryValue* GetInstallPreferences(const CommandLine& cmd_line);
30 30
31 // Gets the value of given boolean preference |name| from |prefs| dictionary 31 // Gets the value of given boolean preference |name| from |prefs| dictionary
32 // which is assumed to contain a dictionary named "distribution". Returns 32 // which is assumed to contain a dictionary named "distribution". Returns
33 // true if the value is read successfully, otherwise false. 33 // true if the value is read successfully, otherwise false.
34 bool GetDistroBooleanPreference(const DictionaryValue* prefs, 34 bool GetDistroBooleanPreference(const DictionaryValue* prefs,
35 const std::wstring& name, 35 const std::string& name,
36 bool* value); 36 bool* value);
37 37
38 // This function gets value of a string preference from master 38 // This function gets value of a string preference from master
39 // preferences. Returns true if the value is read successfully, otherwise false. 39 // preferences. Returns true if the value is read successfully, otherwise false.
40 bool GetDistroStringPreference(const DictionaryValue* prefs, 40 bool GetDistroStringPreference(const DictionaryValue* prefs,
41 const std::wstring& name, 41 const std::string& name,
42 std::wstring* value); 42 std::string* value);
43 43
44 // This function gets value of an integer preference from master 44 // This function gets value of an integer preference from master
45 // preferences. Returns true if the value is read successfully, otherwise false. 45 // preferences. Returns true if the value is read successfully, otherwise false.
46 bool GetDistroIntegerPreference(const DictionaryValue* prefs, 46 bool GetDistroIntegerPreference(const DictionaryValue* prefs,
47 const std::wstring& name, 47 const std::string& name,
48 int* value); 48 int* value);
49 49
50 // The master preferences is a JSON file with the same entries as the 50 // The master preferences is a JSON file with the same entries as the
51 // 'Default\Preferences' file. This function parses the distribution 51 // 'Default\Preferences' file. This function parses the distribution
52 // section of the preferences file. 52 // section of the preferences file.
53 // 53 //
54 // A prototypical 'master_preferences' file looks like this: 54 // A prototypical 'master_preferences' file looks like this:
55 // 55 //
56 // { 56 // {
57 // "distribution": { 57 // "distribution": {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // 107 //
108 // Note that the entries are usually urls but they don't have to. 108 // Note that the entries are usually urls but they don't have to.
109 // 109 //
110 // This function retuns the list as a vector of GURLs. If the master 110 // This function retuns the list as a vector of GURLs. If the master
111 // preferences file does not contain such list the vector is empty. 111 // preferences file does not contain such list the vector is empty.
112 std::vector<GURL> GetFirstRunTabs(const DictionaryValue* prefs); 112 std::vector<GURL> GetFirstRunTabs(const DictionaryValue* prefs);
113 113
114 // Sets the value of given boolean preference |name| in "distribution" 114 // Sets the value of given boolean preference |name| in "distribution"
115 // dictionary inside |prefs| dictionary. 115 // dictionary inside |prefs| dictionary.
116 bool SetDistroBooleanPreference(DictionaryValue* prefs, 116 bool SetDistroBooleanPreference(DictionaryValue* prefs,
117 const std::wstring& name, 117 const std::string& name,
118 bool value); 118 bool value);
119 119
120 // The master preferences can also contain a regular extensions 120 // The master preferences can also contain a regular extensions
121 // preference block. If so, the extensions referenced there will be 121 // preference block. If so, the extensions referenced there will be
122 // installed during the first run experience. 122 // installed during the first run experience.
123 // An extension can go in the master prefs needs just the basic 123 // An extension can go in the master prefs needs just the basic
124 // elements such as: 124 // elements such as:
125 // 1- An extension entry under settings, assigned by the gallery 125 // 1- An extension entry under settings, assigned by the gallery
126 // 2- The "location" : 1 entry 126 // 2- The "location" : 1 entry
127 // 3- A minimal "manifest" block with key, name, permissions, update url 127 // 3- A minimal "manifest" block with key, name, permissions, update url
(...skipping 23 matching lines...) Expand all
151 // } 151 // }
152 // } 152 // }
153 // } 153 // }
154 // 154 //
155 bool HasExtensionsBlock(const DictionaryValue* prefs, 155 bool HasExtensionsBlock(const DictionaryValue* prefs,
156 DictionaryValue** extensions); 156 DictionaryValue** extensions);
157 157
158 } // namespace installer_util 158 } // namespace installer_util
159 159
160 #endif // CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_ 160 #endif // CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_
OLDNEW
« no previous file with comments | « chrome/common/plugin_group_unittest.cc ('k') | chrome/installer/util/master_preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698