OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser/plugins/plugins_resource_service.h" | 5 #include "chrome/browser/plugins/plugins_resource_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/ptr_util.h" |
9 #include "build/build_config.h" | 10 #include "build/build_config.h" |
10 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/plugins/plugin_finder.h" | 12 #include "chrome/browser/plugins/plugin_finder.h" |
12 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
14 #include "components/prefs/pref_registry_simple.h" | 15 #include "components/prefs/pref_registry_simple.h" |
15 #include "components/prefs/pref_service.h" | 16 #include "components/prefs/pref_service.h" |
16 #include "components/safe_json/safe_json_parser.h" | 17 #include "components/safe_json/safe_json_parser.h" |
17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
18 | 19 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 PluginFinder::GetInstance()->ReinitializePlugins(metadata); | 65 PluginFinder::GetInstance()->ReinitializePlugins(metadata); |
65 StartAfterDelay(); | 66 StartAfterDelay(); |
66 } | 67 } |
67 | 68 |
68 PluginsResourceService::~PluginsResourceService() { | 69 PluginsResourceService::~PluginsResourceService() { |
69 } | 70 } |
70 | 71 |
71 // static | 72 // static |
72 void PluginsResourceService::RegisterPrefs(PrefRegistrySimple* registry) { | 73 void PluginsResourceService::RegisterPrefs(PrefRegistrySimple* registry) { |
73 registry->RegisterDictionaryPref(prefs::kPluginsMetadata, | 74 registry->RegisterDictionaryPref(prefs::kPluginsMetadata, |
74 new base::DictionaryValue()); | 75 base::MakeUnique<base::DictionaryValue>()); |
75 registry->RegisterStringPref(prefs::kPluginsResourceCacheUpdate, "0"); | 76 registry->RegisterStringPref(prefs::kPluginsResourceCacheUpdate, "0"); |
76 } | 77 } |
77 | 78 |
78 void PluginsResourceService::Unpack(const base::DictionaryValue& parsed_json) { | 79 void PluginsResourceService::Unpack(const base::DictionaryValue& parsed_json) { |
79 prefs_->Set(prefs::kPluginsMetadata, parsed_json); | 80 prefs_->Set(prefs::kPluginsMetadata, parsed_json); |
80 PluginFinder::GetInstance()->ReinitializePlugins(&parsed_json); | 81 PluginFinder::GetInstance()->ReinitializePlugins(&parsed_json); |
81 } | 82 } |
OLD | NEW |