OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 | 18 |
| 19 class FilePath; |
| 20 |
| 21 namespace base { |
19 class DictionaryValue; | 22 class DictionaryValue; |
20 class FilePath; | 23 } |
21 | 24 |
22 namespace installer { | 25 namespace installer { |
23 | 26 |
24 // This is the default name for the master preferences file used to pre-set | 27 // This is the default name for the master preferences file used to pre-set |
25 // values in the user profile at first run. | 28 // values in the user profile at first run. |
26 const char kDefaultMasterPrefs[] = "master_preferences"; | 29 const char kDefaultMasterPrefs[] = "master_preferences"; |
27 | 30 |
28 // The master preferences is a JSON file with the same entries as the | 31 // The master preferences is a JSON file with the same entries as the |
29 // 'Default\Preferences' file. This function parses the distribution | 32 // 'Default\Preferences' file. This function parses the distribution |
30 // section of the preferences file. | 33 // section of the preferences file. |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // "update_url": "http://fixme.com/fixme/fixme/crx", | 145 // "update_url": "http://fixme.com/fixme/fixme/crx", |
143 // "version": "0.0" | 146 // "version": "0.0" |
144 // }, | 147 // }, |
145 // "path": "ppflmjolhbonpkbkooiamcnenbmbjcbb\\0.0", | 148 // "path": "ppflmjolhbonpkbkooiamcnenbmbjcbb\\0.0", |
146 // "state": 1 | 149 // "state": 1 |
147 // } | 150 // } |
148 // } | 151 // } |
149 // } | 152 // } |
150 // } | 153 // } |
151 // | 154 // |
152 bool GetExtensionsBlock(DictionaryValue** extensions) const; | 155 bool GetExtensionsBlock(base::DictionaryValue** extensions) const; |
153 | 156 |
154 // Returns true iff the master preferences were successfully read from a file. | 157 // Returns true iff the master preferences were successfully read from a file. |
155 bool read_from_file() const { | 158 bool read_from_file() const { |
156 return preferences_read_from_file_; | 159 return preferences_read_from_file_; |
157 } | 160 } |
158 | 161 |
159 bool install_ceee() const { | 162 bool install_ceee() const { |
160 return ceee_; | 163 return ceee_; |
161 } | 164 } |
162 | 165 |
(...skipping 14 matching lines...) Expand all Loading... |
177 // NOTE: Must not be called before CommandLine::Init() is called! | 180 // NOTE: Must not be called before CommandLine::Init() is called! |
178 // OTHER NOTE: Not thread safe. | 181 // OTHER NOTE: Not thread safe. |
179 static const MasterPreferences& ForCurrentProcess(); | 182 static const MasterPreferences& ForCurrentProcess(); |
180 | 183 |
181 protected: | 184 protected: |
182 void InitializeProductFlags(); | 185 void InitializeProductFlags(); |
183 | 186 |
184 void InitializeFromCommandLine(const CommandLine& cmd_line); | 187 void InitializeFromCommandLine(const CommandLine& cmd_line); |
185 | 188 |
186 protected: | 189 protected: |
187 scoped_ptr<DictionaryValue> master_dictionary_; | 190 scoped_ptr<base::DictionaryValue> master_dictionary_; |
188 DictionaryValue* distribution_; | 191 base::DictionaryValue* distribution_; |
189 bool preferences_read_from_file_; | 192 bool preferences_read_from_file_; |
190 bool ceee_; | 193 bool ceee_; |
191 bool chrome_; | 194 bool chrome_; |
192 bool chrome_frame_; | 195 bool chrome_frame_; |
193 bool multi_install_; | 196 bool multi_install_; |
194 | 197 |
195 private: | 198 private: |
196 DISALLOW_COPY_AND_ASSIGN(MasterPreferences); | 199 DISALLOW_COPY_AND_ASSIGN(MasterPreferences); |
197 }; | 200 }; |
198 | 201 |
199 } // namespace installer | 202 } // namespace installer |
200 | 203 |
201 #endif // CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_ | 204 #endif // CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_ |
OLD | NEW |