| 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 "chrome/browser/plugins/plugin_prefs.h" | 8 #include "chrome/browser/plugins/plugin_prefs.h" |
| 9 #include "chrome/browser/prefs/pref_registry_syncable.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_dependency_manager.h" | 12 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 12 #include "chrome/browser/profiles/profile_keyed_service.h" | 13 #include "chrome/browser/profiles/profile_keyed_service.h" |
| 13 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
| 14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 15 | 16 |
| 16 // static | 17 // static |
| 17 PluginPrefsFactory* PluginPrefsFactory::GetInstance() { | 18 PluginPrefsFactory* PluginPrefsFactory::GetInstance() { |
| 18 return Singleton<PluginPrefsFactory>::get(); | 19 return Singleton<PluginPrefsFactory>::get(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 40 PluginPrefsFactory::~PluginPrefsFactory() {} | 41 PluginPrefsFactory::~PluginPrefsFactory() {} |
| 41 | 42 |
| 42 scoped_refptr<RefcountedProfileKeyedService> | 43 scoped_refptr<RefcountedProfileKeyedService> |
| 43 PluginPrefsFactory::BuildServiceInstanceFor(Profile* profile) const { | 44 PluginPrefsFactory::BuildServiceInstanceFor(Profile* profile) const { |
| 44 scoped_refptr<PluginPrefs> plugin_prefs(new PluginPrefs()); | 45 scoped_refptr<PluginPrefs> plugin_prefs(new PluginPrefs()); |
| 45 plugin_prefs->set_profile(profile->GetOriginalProfile()); | 46 plugin_prefs->set_profile(profile->GetOriginalProfile()); |
| 46 plugin_prefs->SetPrefs(profile->GetPrefs()); | 47 plugin_prefs->SetPrefs(profile->GetPrefs()); |
| 47 return plugin_prefs; | 48 return plugin_prefs; |
| 48 } | 49 } |
| 49 | 50 |
| 50 void PluginPrefsFactory::RegisterUserPrefs(PrefServiceSyncable* prefs) { | 51 void PluginPrefsFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
| 51 FilePath internal_dir; | 52 FilePath internal_dir; |
| 52 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); | 53 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); |
| 53 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, | 54 registry->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, |
| 54 internal_dir, | 55 internal_dir, |
| 55 PrefServiceSyncable::UNSYNCABLE_PREF); | 56 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 56 prefs->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, | 57 registry->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, |
| 57 false, | 58 false, |
| 58 PrefServiceSyncable::UNSYNCABLE_PREF); | 59 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 59 prefs->RegisterBooleanPref(prefs::kPluginsEnabledNaCl, | 60 registry->RegisterBooleanPref(prefs::kPluginsEnabledNaCl, |
| 60 false, | 61 false, |
| 61 PrefServiceSyncable::UNSYNCABLE_PREF); | 62 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 62 prefs->RegisterBooleanPref(prefs::kPluginsMigratedToPepperFlash, | 63 registry->RegisterBooleanPref(prefs::kPluginsMigratedToPepperFlash, |
| 63 false, | 64 false, |
| 64 PrefServiceSyncable::UNSYNCABLE_PREF); | 65 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 65 prefs->RegisterListPref(prefs::kPluginsPluginsList, | 66 registry->RegisterListPref(prefs::kPluginsPluginsList, |
| 66 PrefServiceSyncable::UNSYNCABLE_PREF); | 67 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 67 prefs->RegisterListPref(prefs::kPluginsDisabledPlugins, | 68 registry->RegisterListPref(prefs::kPluginsDisabledPlugins, |
| 68 PrefServiceSyncable::UNSYNCABLE_PREF); | 69 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 69 prefs->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions, | 70 registry->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions, |
| 70 PrefServiceSyncable::UNSYNCABLE_PREF); | 71 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 71 prefs->RegisterListPref(prefs::kPluginsEnabledPlugins, | 72 registry->RegisterListPref(prefs::kPluginsEnabledPlugins, |
| 72 PrefServiceSyncable::UNSYNCABLE_PREF); | 73 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 73 } | 74 } |
| 74 | 75 |
| 75 bool PluginPrefsFactory::ServiceRedirectedInIncognito() const { | 76 bool PluginPrefsFactory::ServiceRedirectedInIncognito() const { |
| 76 return true; | 77 return true; |
| 77 } | 78 } |
| 78 | 79 |
| 79 bool PluginPrefsFactory::ServiceIsNULLWhileTesting() const { | 80 bool PluginPrefsFactory::ServiceIsNULLWhileTesting() const { |
| 80 return true; | 81 return true; |
| 81 } | 82 } |
| 82 | 83 |
| 83 bool PluginPrefsFactory::ServiceIsCreatedWithProfile() const { | 84 bool PluginPrefsFactory::ServiceIsCreatedWithProfile() const { |
| 84 return true; | 85 return true; |
| 85 } | 86 } |
| OLD | NEW |