OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_value_serializer.h" | 9 #include "base/json/json_value_serializer.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "chrome/installer/util/master_preferences_constants.h" | 14 #include "chrome/installer/util/master_preferences_constants.h" |
15 #include "chrome/installer/util/util_constants.h" | 15 #include "chrome/installer/util/util_constants.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 const char kDistroDict[] = "distribution"; | 20 const char kDistroDict[] = "distribution"; |
21 const char kFirstRunTabs[] = "first_run_tabs"; | 21 const char kFirstRunTabs[] = "first_run_tabs"; |
22 | 22 |
23 base::LazyInstance<installer::MasterPreferences> g_master_preferences( | 23 base::LazyInstance<installer::MasterPreferences> g_master_preferences = |
24 base::LINKER_INITIALIZED); | 24 LAZY_INSTANCE_INITIALIZER; |
25 | 25 |
26 bool GetGURLFromValue(const Value* in_value, GURL* out_value) { | 26 bool GetGURLFromValue(const Value* in_value, GURL* out_value) { |
27 if (!in_value || !out_value) | 27 if (!in_value || !out_value) |
28 return false; | 28 return false; |
29 std::string url; | 29 std::string url; |
30 in_value->GetAsString(&url); | 30 in_value->GetAsString(&url); |
31 GURL gurl(url); | 31 GURL gurl(url); |
32 *out_value = gurl; | 32 *out_value = gurl; |
33 return true; | 33 return true; |
34 } | 34 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 bool MasterPreferences::GetExtensionsBlock(DictionaryValue** extensions) const { | 270 bool MasterPreferences::GetExtensionsBlock(DictionaryValue** extensions) const { |
271 return master_dictionary_->GetDictionary( | 271 return master_dictionary_->GetDictionary( |
272 master_preferences::kExtensionsBlock, extensions); | 272 master_preferences::kExtensionsBlock, extensions); |
273 } | 273 } |
274 | 274 |
275 // static | 275 // static |
276 const MasterPreferences& MasterPreferences::ForCurrentProcess() { | 276 const MasterPreferences& MasterPreferences::ForCurrentProcess() { |
277 return g_master_preferences.Get(); | 277 return g_master_preferences.Get(); |
278 } | 278 } |
279 } // installer_util | 279 } // installer_util |
OLD | NEW |