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

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

Issue 7096016: Remove JS dialog dependency from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: one more DEPS item removal Created 9 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) 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698