OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "chrome/browser/extensions/extension_pref_value_map.h" | 7 #include "chrome/browser/extensions/extension_pref_value_map.h" |
8 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" | 8 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" |
9 #include "chrome/browser/extensions/extension_prefs.h" | 9 #include "chrome/browser/extensions/extension_prefs.h" |
10 #include "chrome/browser/extensions/extension_prefs_factory.h" | 10 #include "chrome/browser/extensions/extension_prefs_factory.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 BrowserContextKeyedService* ExtensionPrefsFactory::BuildServiceInstanceFor( | 46 BrowserContextKeyedService* ExtensionPrefsFactory::BuildServiceInstanceFor( |
47 content::BrowserContext* context) const { | 47 content::BrowserContext* context) const { |
48 Profile* profile = Profile::FromBrowserContext(context); | 48 Profile* profile = Profile::FromBrowserContext(context); |
49 bool extensions_disabled = | 49 bool extensions_disabled = |
50 profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions) || | 50 profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions) || |
51 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions); | 51 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions); |
52 return ExtensionPrefs::Create( | 52 return ExtensionPrefs::Create( |
53 profile->GetPrefs(), | 53 profile->GetPrefs(), |
54 profile->GetPath().AppendASCII(extensions::kInstallDirectoryName), | 54 profile->GetPath().AppendASCII(filenames::kInstallDirectoryName), |
55 ExtensionPrefValueMapFactory::GetForProfile(profile), | 55 ExtensionPrefValueMapFactory::GetForProfile(profile), |
56 extensions_disabled); | 56 extensions_disabled); |
57 } | 57 } |
58 | 58 |
59 content::BrowserContext* ExtensionPrefsFactory::GetBrowserContextToUse( | 59 content::BrowserContext* ExtensionPrefsFactory::GetBrowserContextToUse( |
60 content::BrowserContext* context) const { | 60 content::BrowserContext* context) const { |
61 return chrome::GetBrowserContextRedirectedInIncognito(context); | 61 return chrome::GetBrowserContextRedirectedInIncognito(context); |
62 } | 62 } |
63 | 63 |
64 } // namespace extensions | 64 } // namespace extensions |
OLD | NEW |