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

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

Issue 15937003: Change loading custom auth extension to load from --auth-ext-path value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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
« 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 component_loader->Add(IDR_GAIA_TEST_AUTH_MANIFEST, auth_extension_path); 37 const std::string extension_id =
38 component_loader->AddOrReplace(auth_extension_path);
39
40 if (extension_id.empty())
achuithb 2013/05/23 23:08:59 Sorry, didn't notice this before, but you need cur
Tim Song 2013/05/23 23:15:20 This is a single statement, so it should be work f
achuithb 2013/05/23 23:17:47 Yup, I believe we have an explicit rule in the sty
41 LOG(ERROR) << "Failed to load custom Gaia auth extension given by the "
42 << switches::kAuthExtensionPath << " flag: "
43 << auth_extension_path.value();
38 return; 44 return;
39 } 45 }
40 46
41 bool force_keyboard_oobe = false; 47 bool force_keyboard_oobe = false;
42 #if defined(OS_CHROMEOS) 48 #if defined(OS_CHROMEOS)
43 chromeos::system::StatisticsProvider* provider = 49 chromeos::system::StatisticsProvider* provider =
44 chromeos::system::StatisticsProvider::GetInstance(); 50 chromeos::system::StatisticsProvider::GetInstance();
45 provider->GetMachineFlag(chromeos::kOemKeyboardDrivenOobeKey, 51 provider->GetMachineFlag(chromeos::kOemKeyboardDrivenOobeKey,
46 &force_keyboard_oobe); 52 &force_keyboard_oobe);
47 #endif // OS_CHROMEOS 53 #endif // OS_CHROMEOS
(...skipping 14 matching lines...) Expand all
62 } // namespace 68 } // namespace
63 69
64 ScopedGaiaAuthExtension::ScopedGaiaAuthExtension(Profile* profile) 70 ScopedGaiaAuthExtension::ScopedGaiaAuthExtension(Profile* profile)
65 : profile_(profile) { 71 : profile_(profile) {
66 LoadGaiaAuthExtension(profile_); 72 LoadGaiaAuthExtension(profile_);
67 } 73 }
68 74
69 ScopedGaiaAuthExtension::~ScopedGaiaAuthExtension() { 75 ScopedGaiaAuthExtension::~ScopedGaiaAuthExtension() {
70 UnloadGaiaAuthExtension(profile_); 76 UnloadGaiaAuthExtension(profile_);
71 } 77 }
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