| 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 5076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5087 void TestingAutomationProvider::GetAppModalDialogMessage( | 5087 void TestingAutomationProvider::GetAppModalDialogMessage( |
| 5088 DictionaryValue* args, IPC::Message* reply_message) { | 5088 DictionaryValue* args, IPC::Message* reply_message) { |
| 5089 AutomationJSONReply reply(this, reply_message); | 5089 AutomationJSONReply reply(this, reply_message); |
| 5090 std::string error_msg; | 5090 std::string error_msg; |
| 5091 JavaScriptAppModalDialog* dialog = GetActiveJavaScriptModalDialog(&error_msg); | 5091 JavaScriptAppModalDialog* dialog = GetActiveJavaScriptModalDialog(&error_msg); |
| 5092 if (!dialog) { | 5092 if (!dialog) { |
| 5093 reply.SendError(error_msg); | 5093 reply.SendError(error_msg); |
| 5094 return; | 5094 return; |
| 5095 } | 5095 } |
| 5096 DictionaryValue result_dict; | 5096 DictionaryValue result_dict; |
| 5097 result_dict.SetString("message", WideToUTF8(dialog->message_text())); | 5097 result_dict.SetString("message", UTF16ToUTF8(dialog->message_text())); |
| 5098 reply.SendSuccess(&result_dict); | 5098 reply.SendSuccess(&result_dict); |
| 5099 } | 5099 } |
| 5100 | 5100 |
| 5101 void TestingAutomationProvider::AcceptOrDismissAppModalDialog( | 5101 void TestingAutomationProvider::AcceptOrDismissAppModalDialog( |
| 5102 DictionaryValue* args, IPC::Message* reply_message) { | 5102 DictionaryValue* args, IPC::Message* reply_message) { |
| 5103 AutomationJSONReply reply(this, reply_message); | 5103 AutomationJSONReply reply(this, reply_message); |
| 5104 bool accept; | 5104 bool accept; |
| 5105 if (!args->GetBoolean("accept", &accept)) { | 5105 if (!args->GetBoolean("accept", &accept)) { |
| 5106 reply.SendError("Missing or invalid 'accept'"); | 5106 reply.SendError("Missing or invalid 'accept'"); |
| 5107 return; | 5107 return; |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5866 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5866 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 5867 | 5867 |
| 5868 Send(reply_message_); | 5868 Send(reply_message_); |
| 5869 redirect_query_ = 0; | 5869 redirect_query_ = 0; |
| 5870 reply_message_ = NULL; | 5870 reply_message_ = NULL; |
| 5871 } | 5871 } |
| 5872 | 5872 |
| 5873 void TestingAutomationProvider::OnRemoveProvider() { | 5873 void TestingAutomationProvider::OnRemoveProvider() { |
| 5874 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5874 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 5875 } | 5875 } |
| OLD | NEW |