Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: trunk/src/chrome/browser/extensions/scoped_gaia_auth_extension.cc

Issue 16210002: Revert 202926 "Change loading custom auth extension to load from..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16 matching lines...) Expand all
27 ExtensionService* extension_service = extension_system->extension_service(); 27 ExtensionService* extension_service = extension_system->extension_service();
28 return extension_service->component_loader(); 28 return extension_service->component_loader();
29 } 29 }
30 30
31 void LoadGaiaAuthExtension(Profile* profile) { 31 void LoadGaiaAuthExtension(Profile* profile) {
32 extensions::ComponentLoader* component_loader = GetComponentLoader(profile); 32 extensions::ComponentLoader* component_loader = GetComponentLoader(profile);
33 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 33 const CommandLine* command_line = CommandLine::ForCurrentProcess();
34 if (command_line->HasSwitch(switches::kAuthExtensionPath)) { 34 if (command_line->HasSwitch(switches::kAuthExtensionPath)) {
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 const std::string extension_id = 37 component_loader->Add(IDR_GAIA_TEST_AUTH_MANIFEST, auth_extension_path);
38 component_loader->AddOrReplace(auth_extension_path);
39
40 if (extension_id.empty()) {
41 LOG(ERROR) << "Failed to load custom Gaia auth extension given by the "
42 << switches::kAuthExtensionPath << " flag: "
43 << auth_extension_path.value();
44 }
45 return; 38 return;
46 } 39 }
47 40
48 bool force_keyboard_oobe = false; 41 bool force_keyboard_oobe = false;
49 #if defined(OS_CHROMEOS) 42 #if defined(OS_CHROMEOS)
50 chromeos::system::StatisticsProvider* provider = 43 chromeos::system::StatisticsProvider* provider =
51 chromeos::system::StatisticsProvider::GetInstance(); 44 chromeos::system::StatisticsProvider::GetInstance();
52 provider->GetMachineFlag(chromeos::kOemKeyboardDrivenOobeKey, 45 provider->GetMachineFlag(chromeos::kOemKeyboardDrivenOobeKey,
53 &force_keyboard_oobe); 46 &force_keyboard_oobe);
54 #endif // OS_CHROMEOS 47 #endif // OS_CHROMEOS
(...skipping 14 matching lines...) Expand all
69 } // namespace 62 } // namespace
70 63
71 ScopedGaiaAuthExtension::ScopedGaiaAuthExtension(Profile* profile) 64 ScopedGaiaAuthExtension::ScopedGaiaAuthExtension(Profile* profile)
72 : profile_(profile) { 65 : profile_(profile) {
73 LoadGaiaAuthExtension(profile_); 66 LoadGaiaAuthExtension(profile_);
74 } 67 }
75 68
76 ScopedGaiaAuthExtension::~ScopedGaiaAuthExtension() { 69 ScopedGaiaAuthExtension::~ScopedGaiaAuthExtension() {
77 UnloadGaiaAuthExtension(profile_); 70 UnloadGaiaAuthExtension(profile_);
78 } 71 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698