| OLD | NEW |
| 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 // 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 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Construct a master preferences from the current process' current command | 78 // Construct a master preferences from the current process' current command |
| 79 // line. Equivalent to calling | 79 // line. Equivalent to calling |
| 80 // MasterPreferences(*CommandLine::ForCurrentProcess()). | 80 // MasterPreferences(*CommandLine::ForCurrentProcess()). |
| 81 MasterPreferences(); | 81 MasterPreferences(); |
| 82 | 82 |
| 83 // Parses the command line and optionally reads the master preferences file | 83 // Parses the command line and optionally reads the master preferences file |
| 84 // to get distribution related install options (if the "installerdata" switch | 84 // to get distribution related install options (if the "installerdata" switch |
| 85 // is present in the command line. | 85 // is present in the command line. |
| 86 // The options from the preference file and command line are merged, with the | 86 // The options from the preference file and command line are merged, with the |
| 87 // ones from the command line taking precedence in case of a conflict. | 87 // ones from the command line taking precedence in case of a conflict. |
| 88 explicit MasterPreferences(const CommandLine& cmd_line); | 88 explicit MasterPreferences(const base::CommandLine& cmd_line); |
| 89 | 89 |
| 90 // Parses a specific preferences file and does not merge any command line | 90 // Parses a specific preferences file and does not merge any command line |
| 91 // switches with the distribution dictionary. | 91 // switches with the distribution dictionary. |
| 92 explicit MasterPreferences(const base::FilePath& prefs_path); | 92 explicit MasterPreferences(const base::FilePath& prefs_path); |
| 93 | 93 |
| 94 // Parses a preferences directly from |prefs| and does not merge any command | 94 // Parses a preferences directly from |prefs| and does not merge any command |
| 95 // line switches with the distribution dictionary. | 95 // line switches with the distribution dictionary. |
| 96 explicit MasterPreferences(const std::string& prefs); | 96 explicit MasterPreferences(const std::string& prefs); |
| 97 | 97 |
| 98 ~MasterPreferences(); | 98 ~MasterPreferences(); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 return *master_dictionary_.get(); | 184 return *master_dictionary_.get(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 // Returns a static preference object that has been initialized with the | 187 // Returns a static preference object that has been initialized with the |
| 188 // CommandLine object for the current process. | 188 // CommandLine object for the current process. |
| 189 // NOTE: Must not be called before CommandLine::Init() is called! | 189 // NOTE: Must not be called before CommandLine::Init() is called! |
| 190 // OTHER NOTE: Not thread safe. | 190 // OTHER NOTE: Not thread safe. |
| 191 static const MasterPreferences& ForCurrentProcess(); | 191 static const MasterPreferences& ForCurrentProcess(); |
| 192 | 192 |
| 193 protected: | 193 protected: |
| 194 void InitializeFromCommandLine(const CommandLine& cmd_line); | 194 void InitializeFromCommandLine(const base::CommandLine& cmd_line); |
| 195 | 195 |
| 196 // Initializes the instance from a given JSON string, returning true if the | 196 // Initializes the instance from a given JSON string, returning true if the |
| 197 // string was successfully parsed. | 197 // string was successfully parsed. |
| 198 bool InitializeFromString(const std::string& json_data); | 198 bool InitializeFromString(const std::string& json_data); |
| 199 | 199 |
| 200 void InitializeProductFlags(); | 200 void InitializeProductFlags(); |
| 201 | 201 |
| 202 // Enforces legacy preferences that should no longer be used, but could be | 202 // Enforces legacy preferences that should no longer be used, but could be |
| 203 // found in older master_preferences files. | 203 // found in older master_preferences files. |
| 204 void EnforceLegacyPreferences(); | 204 void EnforceLegacyPreferences(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 215 bool chrome_app_launcher_; | 215 bool chrome_app_launcher_; |
| 216 bool multi_install_; | 216 bool multi_install_; |
| 217 | 217 |
| 218 private: | 218 private: |
| 219 DISALLOW_COPY_AND_ASSIGN(MasterPreferences); | 219 DISALLOW_COPY_AND_ASSIGN(MasterPreferences); |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 } // namespace installer | 222 } // namespace installer |
| 223 | 223 |
| 224 #endif // CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_ | 224 #endif // CHROME_INSTALLER_UTIL_MASTER_PREFERENCES_H_ |
| OLD | NEW |