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 5176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5187 void TestingAutomationProvider::GetAppModalDialogMessage( | 5187 void TestingAutomationProvider::GetAppModalDialogMessage( |
5188 DictionaryValue* args, IPC::Message* reply_message) { | 5188 DictionaryValue* args, IPC::Message* reply_message) { |
5189 AutomationJSONReply reply(this, reply_message); | 5189 AutomationJSONReply reply(this, reply_message); |
5190 std::string error_msg; | 5190 std::string error_msg; |
5191 JavaScriptAppModalDialog* dialog = GetActiveJavaScriptModalDialog(&error_msg); | 5191 JavaScriptAppModalDialog* dialog = GetActiveJavaScriptModalDialog(&error_msg); |
5192 if (!dialog) { | 5192 if (!dialog) { |
5193 reply.SendError(error_msg); | 5193 reply.SendError(error_msg); |
5194 return; | 5194 return; |
5195 } | 5195 } |
5196 DictionaryValue result_dict; | 5196 DictionaryValue result_dict; |
5197 result_dict.SetString("message", WideToUTF8(dialog->message_text())); | 5197 result_dict.SetString("message", UTF16ToUTF8(dialog->message_text())); |
5198 reply.SendSuccess(&result_dict); | 5198 reply.SendSuccess(&result_dict); |
5199 } | 5199 } |
5200 | 5200 |
5201 void TestingAutomationProvider::AcceptOrDismissAppModalDialog( | 5201 void TestingAutomationProvider::AcceptOrDismissAppModalDialog( |
5202 DictionaryValue* args, IPC::Message* reply_message) { | 5202 DictionaryValue* args, IPC::Message* reply_message) { |
5203 AutomationJSONReply reply(this, reply_message); | 5203 AutomationJSONReply reply(this, reply_message); |
5204 bool accept; | 5204 bool accept; |
5205 if (!args->GetBoolean("accept", &accept)) { | 5205 if (!args->GetBoolean("accept", &accept)) { |
5206 reply.SendError("Missing or invalid 'accept'"); | 5206 reply.SendError("Missing or invalid 'accept'"); |
5207 return; | 5207 return; |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5965 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5965 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
5966 | 5966 |
5967 Send(reply_message_); | 5967 Send(reply_message_); |
5968 redirect_query_ = 0; | 5968 redirect_query_ = 0; |
5969 reply_message_ = NULL; | 5969 reply_message_ = NULL; |
5970 } | 5970 } |
5971 | 5971 |
5972 void TestingAutomationProvider::OnRemoveProvider() { | 5972 void TestingAutomationProvider::OnRemoveProvider() { |
5973 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5973 AutomationProviderList::GetInstance()->RemoveProvider(this); |
5974 } | 5974 } |
OLD | NEW |