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

Side by Side Diff: chrome/browser/automation/testing_automation_provider_chromeos.cc

Issue 10533038: Switch back to the old method of launching the login flow while keeping some of the benefits of the… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Nirnimesh's comments and fixed chromeos_login.py to work with these changes. Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 IPC::Message* reply_message) { 271 IPC::Message* reply_message) {
272 LOG(ERROR) << "TestingAutomationProvider::LoginAsGuest"; 272 LOG(ERROR) << "TestingAutomationProvider::LoginAsGuest";
273 273
274 chromeos::ExistingUserController* controller = 274 chromeos::ExistingUserController* controller =
275 chromeos::ExistingUserController::current_controller(); 275 chromeos::ExistingUserController::current_controller();
276 // Return immediately, since we're going to die before the login is finished. 276 // Return immediately, since we're going to die before the login is finished.
277 AutomationJSONReply(this, reply_message).SendSuccess(NULL); 277 AutomationJSONReply(this, reply_message).SendSuccess(NULL);
278 controller->LoginAsGuest(); 278 controller->LoginAsGuest();
279 } 279 }
280 280
281 void TestingAutomationProvider::SubmitLoginForm(DictionaryValue* args,
282 IPC::Message* reply_message) {
283 AutomationJSONReply reply(this, reply_message);
284 VLOG(2) << "TestingAutomationProvider::StartLogin";
285
286 std::string username, password;
287 if (!args->GetString("username", &username) ||
288 !args->GetString("password", &password)) {
289 reply.SendError("Invalid or missing args.");
290 return;
291 }
292
293 chromeos::ExistingUserController* controller =
294 chromeos::ExistingUserController::current_controller();
295 if (!controller) {
296 reply.SendError("Unable to access ExistingUserController");
297 return;
298 }
299
300 // WebUI login.
301 chromeos::WebUILoginDisplay* webui_login_display =
302 static_cast<chromeos::WebUILoginDisplay*>(controller->login_display());
303 VLOG(2) << "TestingAutomationProvider::StartLogin ShowSigninScreenForCreds("
304 << username << ", " << password << ")";
305
306 webui_login_display->ShowSigninScreenForCreds(username, password);
307 reply.SendSuccess(NULL);
308 }
309
281 void TestingAutomationProvider::AddLoginEventObserver( 310 void TestingAutomationProvider::AddLoginEventObserver(
282 DictionaryValue* args, IPC::Message* reply_message) { 311 DictionaryValue* args, IPC::Message* reply_message) {
283 chromeos::ExistingUserController* controller = 312 chromeos::ExistingUserController* controller =
284 chromeos::ExistingUserController::current_controller(); 313 chromeos::ExistingUserController::current_controller();
285 AutomationJSONReply reply(this, reply_message); 314 AutomationJSONReply reply(this, reply_message);
286 if (!controller) { 315 if (!controller) {
287 reply.SendError("Unable to access ExistingUserController"); 316 reply.SendError("Unable to access ExistingUserController");
288 return; 317 return;
289 } 318 }
290 319
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> 1277 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
1249 AddObserver(power_manager_observer_); 1278 AddObserver(power_manager_observer_);
1250 } 1279 }
1251 1280
1252 void TestingAutomationProvider::RemoveChromeosObservers() { 1281 void TestingAutomationProvider::RemoveChromeosObservers() {
1253 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> 1282 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
1254 RemoveObserver(power_manager_observer_); 1283 RemoveObserver(power_manager_observer_);
1255 delete power_manager_observer_; 1284 delete power_manager_observer_;
1256 power_manager_observer_ = NULL; 1285 power_manager_observer_ = NULL;
1257 } 1286 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/test/functional/chromeos_login.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698