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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "base/json/json_string_value_serializer.h" | 11 #include "base/json/json_string_value_serializer.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/common/env_vars.h" | 17 #include "chrome/common/env_vars.h" |
18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
19 #include "chrome/installer/util/master_preferences_constants.h" | 19 #include "chrome/installer/util/master_preferences_constants.h" |
20 #include "chrome/installer/util/util_constants.h" | 20 #include "chrome/installer/util/util_constants.h" |
21 #include "components/variations/pref_names.h" | 21 #include "components/variations/pref_names.h" |
22 #include "rlz/features/features.h" | 22 #include "rlz/features/features.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 const char kFirstRunTabs[] = "first_run_tabs"; | 26 const char kFirstRunTabs[] = "first_run_tabs"; |
27 | 27 |
28 base::LazyInstance<installer::MasterPreferences> g_master_preferences = | 28 base::LazyInstance<installer::MasterPreferences>::DestructorAtExit |
29 LAZY_INSTANCE_INITIALIZER; | 29 g_master_preferences = LAZY_INSTANCE_INITIALIZER; |
30 | 30 |
31 bool GetURLFromValue(const base::Value* in_value, std::string* out_value) { | 31 bool GetURLFromValue(const base::Value* in_value, std::string* out_value) { |
32 return in_value && out_value && in_value->GetAsString(out_value); | 32 return in_value && out_value && in_value->GetAsString(out_value); |
33 } | 33 } |
34 | 34 |
35 std::vector<std::string> GetNamedList(const char* name, | 35 std::vector<std::string> GetNamedList(const char* name, |
36 const base::DictionaryValue* prefs) { | 36 const base::DictionaryValue* prefs) { |
37 std::vector<std::string> list; | 37 std::vector<std::string> list; |
38 if (!prefs) | 38 if (!prefs) |
39 return list; | 39 return list; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } | 290 } |
291 return result; | 291 return result; |
292 } | 292 } |
293 | 293 |
294 // static | 294 // static |
295 const MasterPreferences& MasterPreferences::ForCurrentProcess() { | 295 const MasterPreferences& MasterPreferences::ForCurrentProcess() { |
296 return g_master_preferences.Get(); | 296 return g_master_preferences.Get(); |
297 } | 297 } |
298 | 298 |
299 } // namespace installer | 299 } // namespace installer |
OLD | NEW |