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 #include "chrome/installer/util/master_preferences.h" | 5 #include "chrome/installer/util/master_preferences.h" |
6 | 6 |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 NOTREACHED(); | 44 NOTREACHED(); |
45 break; | 45 break; |
46 } | 46 } |
47 list.push_back(url_entry); | 47 list.push_back(url_entry); |
48 } | 48 } |
49 return list; | 49 return list; |
50 } | 50 } |
51 | 51 |
52 base::DictionaryValue* ParseDistributionPreferences( | 52 base::DictionaryValue* ParseDistributionPreferences( |
53 const std::string& json_data) { | 53 const std::string& json_data) { |
54 JSONStringValueSerializer json(json_data); | 54 JSONStringValueDeserializer json(json_data); |
55 std::string error; | 55 std::string error; |
56 scoped_ptr<base::Value> root(json.Deserialize(NULL, &error)); | 56 scoped_ptr<base::Value> root(json.Deserialize(NULL, &error)); |
57 if (!root.get()) { | 57 if (!root.get()) { |
58 LOG(WARNING) << "Failed to parse master prefs file: " << error; | 58 LOG(WARNING) << "Failed to parse master prefs file: " << error; |
59 return NULL; | 59 return NULL; |
60 } | 60 } |
61 if (!root->IsType(base::Value::TYPE_DICTIONARY)) { | 61 if (!root->IsType(base::Value::TYPE_DICTIONARY)) { |
62 LOG(WARNING) << "Failed to parse master prefs file: " | 62 LOG(WARNING) << "Failed to parse master prefs file: " |
63 << "Root item must be a dictionary."; | 63 << "Root item must be a dictionary."; |
64 return NULL; | 64 return NULL; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 314 } |
315 return result; | 315 return result; |
316 } | 316 } |
317 | 317 |
318 // static | 318 // static |
319 const MasterPreferences& MasterPreferences::ForCurrentProcess() { | 319 const MasterPreferences& MasterPreferences::ForCurrentProcess() { |
320 return g_master_preferences.Get(); | 320 return g_master_preferences.Get(); |
321 } | 321 } |
322 | 322 |
323 } // namespace installer | 323 } // namespace installer |
OLD | NEW |