OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/installer/util/master_preferences.h" | 5 #include "chrome/installer/util/master_preferences.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/string_util.h" | |
tony
2010/08/06 00:09:38
Nit: sort
| |
8 #include "base/logging.h" | 9 #include "base/logging.h" |
9 #include "base/path_service.h" | 10 #include "base/path_service.h" |
10 #include "chrome/common/json_value_serializer.h" | 11 #include "chrome/common/json_value_serializer.h" |
11 #include "chrome/installer/util/util_constants.h" | 12 #include "chrome/installer/util/util_constants.h" |
12 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
13 | 14 |
14 | 15 |
15 namespace { | 16 namespace { |
16 const wchar_t* kDistroDict = L"distribution"; | 17 const wchar_t* kDistroDict = L"distribution"; |
17 | 18 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 if (!distro->GetInteger(name, value)) | 100 if (!distro->GetInteger(name, value)) |
100 return false; | 101 return false; |
101 | 102 |
102 return true; | 103 return true; |
103 } | 104 } |
104 | 105 |
105 DictionaryValue* GetInstallPreferences(const CommandLine& cmd_line) { | 106 DictionaryValue* GetInstallPreferences(const CommandLine& cmd_line) { |
106 DictionaryValue* prefs = NULL; | 107 DictionaryValue* prefs = NULL; |
107 #if defined(OS_WIN) | 108 #if defined(OS_WIN) |
108 if (cmd_line.HasSwitch(installer_util::switches::kInstallerData)) { | 109 if (cmd_line.HasSwitch(installer_util::switches::kInstallerData)) { |
109 FilePath prefs_path( | 110 FilePath prefs_path = cmd_line.GetSwitchValuePath( |
110 cmd_line.GetSwitchValue(installer_util::switches::kInstallerData)); | 111 installer_util::switches::kInstallerData); |
111 prefs = installer_util::ParseDistributionPreferences(prefs_path); | 112 prefs = installer_util::ParseDistributionPreferences(prefs_path); |
112 } | 113 } |
113 | 114 |
114 if (!prefs) | 115 if (!prefs) |
115 prefs = new DictionaryValue(); | 116 prefs = new DictionaryValue(); |
116 | 117 |
117 if (cmd_line.HasSwitch(installer_util::switches::kChromeFrame)) | 118 if (cmd_line.HasSwitch(installer_util::switches::kChromeFrame)) |
118 installer_util::SetDistroBooleanPreference( | 119 installer_util::SetDistroBooleanPreference( |
119 prefs, installer_util::master_preferences::kChromeFrame, true); | 120 prefs, installer_util::master_preferences::kChromeFrame, true); |
120 | 121 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 return true; | 198 return true; |
198 } | 199 } |
199 | 200 |
200 bool HasExtensionsBlock(const DictionaryValue* prefs, | 201 bool HasExtensionsBlock(const DictionaryValue* prefs, |
201 DictionaryValue** extensions) { | 202 DictionaryValue** extensions) { |
202 return (prefs->GetDictionary(master_preferences::kExtensionsBlock, | 203 return (prefs->GetDictionary(master_preferences::kExtensionsBlock, |
203 extensions)); | 204 extensions)); |
204 } | 205 } |
205 | 206 |
206 } // installer_util | 207 } // installer_util |
OLD | NEW |