OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/extensions/signin/gaia_auth_extension_loader.h" | 5 #include "chrome/browser/extensions/signin/gaia_auth_extension_loader.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "chrome/browser/extensions/component_loader.h" | 11 #include "chrome/browser/extensions/component_loader.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
16 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/storage_partition.h" | 18 #include "content/public/browser/storage_partition.h" |
19 #include "extensions/browser/extension_system.h" | 19 #include "extensions/browser/extension_system.h" |
20 #include "grit/browser_resources.h" | 20 #include "grit/browser_resources.h" |
21 | 21 |
22 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
23 #include "base/file_util.h" | 23 #include "base/file_util.h" |
| 24 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
24 #include "chrome/browser/chromeos/system/input_device_settings.h" | 25 #include "chrome/browser/chromeos/system/input_device_settings.h" |
25 #include "chromeos/chromeos_constants.h" | 26 #include "chromeos/chromeos_constants.h" |
26 #include "chromeos/chromeos_switches.h" | 27 #include "chromeos/chromeos_switches.h" |
| 28 #include "components/signin/core/common/profile_management_switches.h" |
27 #endif | 29 #endif |
28 | 30 |
29 using content::BrowserContext; | 31 using content::BrowserContext; |
30 using content::BrowserThread; | 32 using content::BrowserThread; |
31 | 33 |
32 namespace { | 34 namespace { |
33 | 35 |
34 extensions::ComponentLoader* GetComponentLoader(BrowserContext* context) { | 36 extensions::ComponentLoader* GetComponentLoader(BrowserContext* context) { |
35 extensions::ExtensionSystem* extension_system = | 37 extensions::ExtensionSystem* extension_system = |
36 extensions::ExtensionSystem::Get(context); | 38 extensions::ExtensionSystem::Get(context); |
(...skipping 11 matching lines...) Expand all Loading... |
48 command_line->GetSwitchValuePath(switches::kAuthExtensionPath); | 50 command_line->GetSwitchValuePath(switches::kAuthExtensionPath); |
49 component_loader->Add(IDR_GAIA_AUTH_MANIFEST, auth_extension_path); | 51 component_loader->Add(IDR_GAIA_AUTH_MANIFEST, auth_extension_path); |
50 return; | 52 return; |
51 } | 53 } |
52 | 54 |
53 #if defined(OS_CHROMEOS) | 55 #if defined(OS_CHROMEOS) |
54 int manifest_resource_id = IDR_GAIA_AUTH_MANIFEST; | 56 int manifest_resource_id = IDR_GAIA_AUTH_MANIFEST; |
55 if (chromeos::system::InputDeviceSettings::Get() | 57 if (chromeos::system::InputDeviceSettings::Get() |
56 ->ForceKeyboardDrivenUINavigation()) { | 58 ->ForceKeyboardDrivenUINavigation()) { |
57 manifest_resource_id = IDR_GAIA_AUTH_KEYBOARD_MANIFEST; | 59 manifest_resource_id = IDR_GAIA_AUTH_KEYBOARD_MANIFEST; |
58 } else if (!command_line->HasSwitch(chromeos::switches::kDisableSamlSignin)) { | 60 } else if (!command_line->HasSwitch(chromeos::switches::kDisableSamlSignin) || |
| 61 (switches::IsNewProfileManagement() && |
| 62 context->GetPath() != |
| 63 chromeos::ProfileHelper::GetSigninProfileDir())) { |
59 manifest_resource_id = IDR_GAIA_AUTH_SAML_MANIFEST; | 64 manifest_resource_id = IDR_GAIA_AUTH_SAML_MANIFEST; |
60 } | 65 } |
61 #else | 66 #else |
62 int manifest_resource_id = IDR_GAIA_AUTH_SAML_MANIFEST; | 67 int manifest_resource_id = IDR_GAIA_AUTH_SAML_MANIFEST; |
63 #endif | 68 #endif |
64 | 69 |
65 component_loader->Add(manifest_resource_id, | 70 component_loader->Add(manifest_resource_id, |
66 base::FilePath(FILE_PATH_LITERAL("gaia_auth"))); | 71 base::FilePath(FILE_PATH_LITERAL("gaia_auth"))); |
67 } | 72 } |
68 | 73 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 BrowserContextKeyedAPIFactory<GaiaAuthExtensionLoader> > g_factory = | 131 BrowserContextKeyedAPIFactory<GaiaAuthExtensionLoader> > g_factory = |
127 LAZY_INSTANCE_INITIALIZER; | 132 LAZY_INSTANCE_INITIALIZER; |
128 | 133 |
129 // static | 134 // static |
130 BrowserContextKeyedAPIFactory<GaiaAuthExtensionLoader>* | 135 BrowserContextKeyedAPIFactory<GaiaAuthExtensionLoader>* |
131 GaiaAuthExtensionLoader::GetFactoryInstance() { | 136 GaiaAuthExtensionLoader::GetFactoryInstance() { |
132 return g_factory.Pointer(); | 137 return g_factory.Pointer(); |
133 } | 138 } |
134 | 139 |
135 } // namespace extensions | 140 } // namespace extensions |
OLD | NEW |