| 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/scoped_gaia_auth_extension.h" | 5 #include "chrome/browser/extensions/scoped_gaia_auth_extension.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/extensions/component_loader.h" | 8 #include "chrome/browser/extensions/component_loader.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 base::FilePath auth_extension_path = | 35 base::FilePath auth_extension_path = |
| 36 command_line->GetSwitchValuePath(switches::kAuthExtensionPath); | 36 command_line->GetSwitchValuePath(switches::kAuthExtensionPath); |
| 37 component_loader->Add(IDR_GAIA_TEST_AUTH_MANIFEST, auth_extension_path); | 37 component_loader->Add(IDR_GAIA_TEST_AUTH_MANIFEST, auth_extension_path); |
| 38 return; | 38 return; |
| 39 } | 39 } |
| 40 | 40 |
| 41 bool force_keyboard_oobe = false; | 41 bool force_keyboard_oobe = false; |
| 42 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
| 43 chromeos::system::StatisticsProvider* provider = | 43 chromeos::system::StatisticsProvider* provider = |
| 44 chromeos::system::StatisticsProvider::GetInstance(); | 44 chromeos::system::StatisticsProvider::GetInstance(); |
| 45 provider->GetMachineFlag(chromeos::kOemKeyboardDrivenOobeKey, | 45 provider->GetMachineFlag(chromeos::system::kOemKeyboardDrivenOobeKey, |
| 46 &force_keyboard_oobe); | 46 &force_keyboard_oobe); |
| 47 #endif // OS_CHROMEOS | 47 #endif // OS_CHROMEOS |
| 48 if (force_keyboard_oobe) { | 48 if (force_keyboard_oobe) { |
| 49 component_loader->Add(IDR_GAIA_AUTH_KEYBOARD_MANIFEST, | 49 component_loader->Add(IDR_GAIA_AUTH_KEYBOARD_MANIFEST, |
| 50 base::FilePath(FILE_PATH_LITERAL("gaia_auth"))); | 50 base::FilePath(FILE_PATH_LITERAL("gaia_auth"))); |
| 51 } else { | 51 } else { |
| 52 component_loader->Add(IDR_GAIA_AUTH_MANIFEST, | 52 component_loader->Add(IDR_GAIA_AUTH_MANIFEST, |
| 53 base::FilePath(FILE_PATH_LITERAL("gaia_auth"))); | 53 base::FilePath(FILE_PATH_LITERAL("gaia_auth"))); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 void UnloadGaiaAuthExtension(Profile* profile) { | 57 void UnloadGaiaAuthExtension(Profile* profile) { |
| 58 const char kGaiaAuthId[] = "mfffpogegjflfpflabcdkioaeobkgjik"; | 58 const char kGaiaAuthId[] = "mfffpogegjflfpflabcdkioaeobkgjik"; |
| 59 GetComponentLoader(profile)->Remove(kGaiaAuthId); | 59 GetComponentLoader(profile)->Remove(kGaiaAuthId); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 ScopedGaiaAuthExtension::ScopedGaiaAuthExtension(Profile* profile) | 64 ScopedGaiaAuthExtension::ScopedGaiaAuthExtension(Profile* profile) |
| 65 : profile_(profile) { | 65 : profile_(profile) { |
| 66 LoadGaiaAuthExtension(profile_); | 66 LoadGaiaAuthExtension(profile_); |
| 67 } | 67 } |
| 68 | 68 |
| 69 ScopedGaiaAuthExtension::~ScopedGaiaAuthExtension() { | 69 ScopedGaiaAuthExtension::~ScopedGaiaAuthExtension() { |
| 70 UnloadGaiaAuthExtension(profile_); | 70 UnloadGaiaAuthExtension(profile_); |
| 71 } | 71 } |
| OLD | NEW |