| 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" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 extensions::ExtensionSystem* extension_system = | 33 extensions::ExtensionSystem* extension_system = |
| 34 extensions::ExtensionSystem::Get(context); | 34 extensions::ExtensionSystem::Get(context); |
| 35 ExtensionService* extension_service = extension_system->extension_service(); | 35 ExtensionService* extension_service = extension_system->extension_service(); |
| 36 return extension_service->component_loader(); | 36 return extension_service->component_loader(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void LoadGaiaAuthExtension(BrowserContext* context) { | 39 void LoadGaiaAuthExtension(BrowserContext* context) { |
| 40 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 40 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 41 | 41 |
| 42 extensions::ComponentLoader* component_loader = GetComponentLoader(context); | 42 extensions::ComponentLoader* component_loader = GetComponentLoader(context); |
| 43 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 43 const base::CommandLine* command_line = |
| 44 base::CommandLine::ForCurrentProcess(); |
| 44 if (command_line->HasSwitch(switches::kAuthExtensionPath)) { | 45 if (command_line->HasSwitch(switches::kAuthExtensionPath)) { |
| 45 base::FilePath auth_extension_path = | 46 base::FilePath auth_extension_path = |
| 46 command_line->GetSwitchValuePath(switches::kAuthExtensionPath); | 47 command_line->GetSwitchValuePath(switches::kAuthExtensionPath); |
| 47 component_loader->Add(IDR_GAIA_AUTH_MANIFEST, auth_extension_path); | 48 component_loader->Add(IDR_GAIA_AUTH_MANIFEST, auth_extension_path); |
| 48 return; | 49 return; |
| 49 } | 50 } |
| 50 | 51 |
| 51 int manifest_resource_id = IDR_GAIA_AUTH_MANIFEST; | 52 int manifest_resource_id = IDR_GAIA_AUTH_MANIFEST; |
| 52 | 53 |
| 53 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 BrowserContextKeyedAPIFactory<GaiaAuthExtensionLoader> > g_factory = | 120 BrowserContextKeyedAPIFactory<GaiaAuthExtensionLoader> > g_factory = |
| 120 LAZY_INSTANCE_INITIALIZER; | 121 LAZY_INSTANCE_INITIALIZER; |
| 121 | 122 |
| 122 // static | 123 // static |
| 123 BrowserContextKeyedAPIFactory<GaiaAuthExtensionLoader>* | 124 BrowserContextKeyedAPIFactory<GaiaAuthExtensionLoader>* |
| 124 GaiaAuthExtensionLoader::GetFactoryInstance() { | 125 GaiaAuthExtensionLoader::GetFactoryInstance() { |
| 125 return g_factory.Pointer(); | 126 return g_factory.Pointer(); |
| 126 } | 127 } |
| 127 | 128 |
| 128 } // namespace extensions | 129 } // namespace extensions |
| OLD | NEW |