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/browser/plugins/plugin_prefs_factory.h" | 5 #include "chrome/browser/plugins/plugin_prefs_factory.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/plugins/plugin_prefs.h" | 9 #include "chrome/browser/plugins/plugin_prefs.h" |
10 #include "chrome/browser/profiles/incognito_helpers.h" | 10 #include "chrome/browser/profiles/incognito_helpers.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 scoped_refptr<RefcountedProfileKeyedService> | 44 scoped_refptr<RefcountedProfileKeyedService> |
45 PluginPrefsFactory::BuildServiceInstanceFor( | 45 PluginPrefsFactory::BuildServiceInstanceFor( |
46 content::BrowserContext* context) const { | 46 content::BrowserContext* context) const { |
47 Profile* profile = static_cast<Profile*>(context); | 47 Profile* profile = static_cast<Profile*>(context); |
48 scoped_refptr<PluginPrefs> plugin_prefs(new PluginPrefs()); | 48 scoped_refptr<PluginPrefs> plugin_prefs(new PluginPrefs()); |
49 plugin_prefs->set_profile(profile->GetOriginalProfile()); | 49 plugin_prefs->set_profile(profile->GetOriginalProfile()); |
50 plugin_prefs->SetPrefs(profile->GetPrefs()); | 50 plugin_prefs->SetPrefs(profile->GetPrefs()); |
51 return plugin_prefs; | 51 return plugin_prefs; |
52 } | 52 } |
53 | 53 |
54 void PluginPrefsFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 54 void PluginPrefsFactory::RegisterUserPrefs( |
| 55 user_prefs::PrefRegistrySyncable* registry) { |
55 base::FilePath internal_dir; | 56 base::FilePath internal_dir; |
56 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); | 57 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); |
57 registry->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, | 58 registry->RegisterFilePathPref( |
58 internal_dir, | 59 prefs::kPluginsLastInternalDirectory, |
59 PrefRegistrySyncable::UNSYNCABLE_PREF); | 60 internal_dir, |
60 registry->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, | 61 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
61 false, | 62 registry->RegisterBooleanPref( |
62 PrefRegistrySyncable::UNSYNCABLE_PREF); | 63 prefs::kPluginsEnabledInternalPDF, |
63 registry->RegisterBooleanPref(prefs::kPluginsEnabledNaCl, | 64 false, |
64 false, | 65 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
65 PrefRegistrySyncable::UNSYNCABLE_PREF); | 66 registry->RegisterBooleanPref( |
66 registry->RegisterBooleanPref(prefs::kPluginsMigratedToPepperFlash, | 67 prefs::kPluginsEnabledNaCl, |
67 false, | 68 false, |
68 PrefRegistrySyncable::UNSYNCABLE_PREF); | 69 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 70 registry->RegisterBooleanPref( |
| 71 prefs::kPluginsMigratedToPepperFlash, |
| 72 false, |
| 73 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
69 registry->RegisterBooleanPref( | 74 registry->RegisterBooleanPref( |
70 prefs::kPluginsRemovedOldComponentPepperFlashSettings, | 75 prefs::kPluginsRemovedOldComponentPepperFlashSettings, |
71 false, | 76 false, |
72 PrefRegistrySyncable::UNSYNCABLE_PREF); | 77 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
73 registry->RegisterListPref(prefs::kPluginsPluginsList, | 78 registry->RegisterListPref(prefs::kPluginsPluginsList, |
74 PrefRegistrySyncable::UNSYNCABLE_PREF); | 79 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
75 registry->RegisterListPref(prefs::kPluginsDisabledPlugins, | 80 registry->RegisterListPref(prefs::kPluginsDisabledPlugins, |
76 PrefRegistrySyncable::UNSYNCABLE_PREF); | 81 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
77 registry->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions, | 82 registry->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions, |
78 PrefRegistrySyncable::UNSYNCABLE_PREF); | 83 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
79 registry->RegisterListPref(prefs::kPluginsEnabledPlugins, | 84 registry->RegisterListPref(prefs::kPluginsEnabledPlugins, |
80 PrefRegistrySyncable::UNSYNCABLE_PREF); | 85 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
81 } | 86 } |
82 | 87 |
83 content::BrowserContext* PluginPrefsFactory::GetBrowserContextToUse( | 88 content::BrowserContext* PluginPrefsFactory::GetBrowserContextToUse( |
84 content::BrowserContext* context) const { | 89 content::BrowserContext* context) const { |
85 return chrome::GetBrowserContextRedirectedInIncognito(context); | 90 return chrome::GetBrowserContextRedirectedInIncognito(context); |
86 } | 91 } |
87 | 92 |
88 bool PluginPrefsFactory::ServiceIsNULLWhileTesting() const { | 93 bool PluginPrefsFactory::ServiceIsNULLWhileTesting() const { |
89 return true; | 94 return true; |
90 } | 95 } |
91 | 96 |
92 bool PluginPrefsFactory::ServiceIsCreatedWithProfile() const { | 97 bool PluginPrefsFactory::ServiceIsCreatedWithProfile() const { |
93 return true; | 98 return true; |
94 } | 99 } |
OLD | NEW |