| 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/file_util.h" | 8 #include "base/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 21 matching lines...) Expand all Loading... |
| 32 GURL gurl(url); | 32 GURL gurl(url); |
| 33 *out_value = gurl; | 33 *out_value = gurl; |
| 34 return true; | 34 return true; |
| 35 } | 35 } |
| 36 | 36 |
| 37 std::vector<GURL> GetNamedList(const char* name, | 37 std::vector<GURL> GetNamedList(const char* name, |
| 38 const DictionaryValue* prefs) { | 38 const DictionaryValue* prefs) { |
| 39 std::vector<GURL> list; | 39 std::vector<GURL> list; |
| 40 if (!prefs) | 40 if (!prefs) |
| 41 return list; | 41 return list; |
| 42 ListValue* value_list = NULL; | 42 const ListValue* value_list = NULL; |
| 43 if (!prefs->GetList(name, &value_list)) | 43 if (!prefs->GetList(name, &value_list)) |
| 44 return list; | 44 return list; |
| 45 for (size_t i = 0; i < value_list->GetSize(); ++i) { | 45 for (size_t i = 0; i < value_list->GetSize(); ++i) { |
| 46 Value* entry; | 46 Value* entry; |
| 47 GURL gurl_entry; | 47 GURL gurl_entry; |
| 48 if (!value_list->Get(i, &entry) || !GetGURLFromValue(entry, &gurl_entry)) { | 48 if (!value_list->Get(i, &entry) || !GetGURLFromValue(entry, &gurl_entry)) { |
| 49 NOTREACHED(); | 49 NOTREACHED(); |
| 50 break; | 50 break; |
| 51 } | 51 } |
| 52 list.push_back(gurl_entry); | 52 list.push_back(gurl_entry); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 bool MasterPreferences::GetExtensionsBlock(DictionaryValue** extensions) const { | 265 bool MasterPreferences::GetExtensionsBlock(DictionaryValue** extensions) const { |
| 266 return master_dictionary_->GetDictionary( | 266 return master_dictionary_->GetDictionary( |
| 267 master_preferences::kExtensionsBlock, extensions); | 267 master_preferences::kExtensionsBlock, extensions); |
| 268 } | 268 } |
| 269 | 269 |
| 270 // static | 270 // static |
| 271 const MasterPreferences& MasterPreferences::ForCurrentProcess() { | 271 const MasterPreferences& MasterPreferences::ForCurrentProcess() { |
| 272 return g_master_preferences.Get(); | 272 return g_master_preferences.Get(); |
| 273 } | 273 } |
| 274 } // installer_util | 274 } // installer_util |
| OLD | NEW |