OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 4269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4280 AutomationJSONReply reply(this, reply_message); | 4280 AutomationJSONReply reply(this, reply_message); |
4281 std::string username; | 4281 std::string username; |
4282 std::string password; | 4282 std::string password; |
4283 if (!args->GetString("username", &username) || | 4283 if (!args->GetString("username", &username) || |
4284 !args->GetString("password", &password)) { | 4284 !args->GetString("password", &password)) { |
4285 reply.SendError("Invalid or missing args"); | 4285 reply.SendError("Invalid or missing args"); |
4286 return; | 4286 return; |
4287 } | 4287 } |
4288 if (sync_waiter_.get() == NULL) { | 4288 if (sync_waiter_.get() == NULL) { |
4289 sync_waiter_.reset(new ProfileSyncServiceHarness( | 4289 sync_waiter_.reset(new ProfileSyncServiceHarness( |
4290 browser->profile(), username, password, 0)); | 4290 browser->profile(), username, password)); |
4291 } else { | 4291 } else { |
4292 sync_waiter_->SetCredentials(username, password); | 4292 sync_waiter_->SetCredentials(username, password); |
4293 } | 4293 } |
4294 if (sync_waiter_->SetupSync()) { | 4294 if (sync_waiter_->SetupSync()) { |
4295 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); | 4295 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); |
4296 return_value->SetBoolean("success", true); | 4296 return_value->SetBoolean("success", true); |
4297 reply.SendSuccess(return_value.get()); | 4297 reply.SendSuccess(return_value.get()); |
4298 } else { | 4298 } else { |
4299 reply.SendError("Signing in to sync was unsuccessful"); | 4299 reply.SendError("Signing in to sync was unsuccessful"); |
4300 } | 4300 } |
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5871 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5871 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
5872 | 5872 |
5873 Send(reply_message_); | 5873 Send(reply_message_); |
5874 redirect_query_ = 0; | 5874 redirect_query_ = 0; |
5875 reply_message_ = NULL; | 5875 reply_message_ = NULL; |
5876 } | 5876 } |
5877 | 5877 |
5878 void TestingAutomationProvider::OnRemoveProvider() { | 5878 void TestingAutomationProvider::OnRemoveProvider() { |
5879 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5879 AutomationProviderList::GetInstance()->RemoveProvider(this); |
5880 } | 5880 } |
OLD | NEW |