| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 5 |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/common/json_value_serializer.h" | 8 #include "chrome/common/json_value_serializer.h" |
| 9 #include "chrome/installer/util/master_preferences.h" | 9 #include "chrome/installer/util/master_preferences.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 DictionaryValue* ReadJSONPrefs(const std::string& data) { | 13 DictionaryValue* ReadJSONPrefs(const std::string& data) { |
| 14 JSONStringValueSerializer json(data); | 14 JSONStringValueSerializer json(data); |
| 15 Value* root; | 15 Value* root; |
| 16 if (!json.Deserialize(&root)) | 16 if (!json.Deserialize(&root, NULL)) |
| 17 return NULL; | 17 return NULL; |
| 18 if (!root->IsType(Value::TYPE_DICTIONARY)) { | 18 if (!root->IsType(Value::TYPE_DICTIONARY)) { |
| 19 delete root; | 19 delete root; |
| 20 return NULL; | 20 return NULL; |
| 21 } | 21 } |
| 22 return static_cast<DictionaryValue*>(root); | 22 return static_cast<DictionaryValue*>(root); |
| 23 } | 23 } |
| 24 | 24 |
| 25 bool GetBooleanPref(const DictionaryValue* prefs, const std::wstring& name) { | 25 bool GetBooleanPref(const DictionaryValue* prefs, const std::wstring& name) { |
| 26 bool value = false; | 26 bool value = false; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (GetBooleanPref(json_root.get(), kSystemLevel)) | 96 if (GetBooleanPref(json_root.get(), kSystemLevel)) |
| 97 parse_result |= MASTER_PROFILE_SYSTEM_LEVEL; | 97 parse_result |= MASTER_PROFILE_SYSTEM_LEVEL; |
| 98 | 98 |
| 99 if (GetBooleanPref(json_root.get(), kVerboseLogging)) | 99 if (GetBooleanPref(json_root.get(), kVerboseLogging)) |
| 100 parse_result |= MASTER_PROFILE_VERBOSE_LOGGING; | 100 parse_result |= MASTER_PROFILE_VERBOSE_LOGGING; |
| 101 | 101 |
| 102 return parse_result; | 102 return parse_result; |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // installer_util | 105 } // installer_util |
| OLD | NEW |