| 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<RefcountedBrowserContextKeyedService> | 44 scoped_refptr<RefcountedBrowserContextKeyedService> |
| 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( | 54 void PluginPrefsFactory::RegisterProfilePrefs( |
| 55 user_prefs::PrefRegistrySyncable* registry) { | 55 user_prefs::PrefRegistrySyncable* registry) { |
| 56 base::FilePath internal_dir; | 56 base::FilePath internal_dir; |
| 57 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); | 57 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); |
| 58 registry->RegisterFilePathPref( | 58 registry->RegisterFilePathPref( |
| 59 prefs::kPluginsLastInternalDirectory, | 59 prefs::kPluginsLastInternalDirectory, |
| 60 internal_dir, | 60 internal_dir, |
| 61 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 61 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 62 registry->RegisterBooleanPref( | 62 registry->RegisterBooleanPref( |
| 63 prefs::kPluginsEnabledInternalPDF, | 63 prefs::kPluginsEnabledInternalPDF, |
| 64 false, | 64 false, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 90 return chrome::GetBrowserContextRedirectedInIncognito(context); | 90 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool PluginPrefsFactory::ServiceIsNULLWhileTesting() const { | 93 bool PluginPrefsFactory::ServiceIsNULLWhileTesting() const { |
| 94 return true; | 94 return true; |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool PluginPrefsFactory::ServiceIsCreatedWithBrowserContext() const { | 97 bool PluginPrefsFactory::ServiceIsCreatedWithBrowserContext() const { |
| 98 return true; | 98 return true; |
| 99 } | 99 } |
| OLD | NEW |