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

Unified Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 6312154: Remove wstring from RVH's run Javascript command.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/automation_provider_observers.cc
===================================================================
--- chrome/browser/automation/automation_provider_observers.cc (revision 73855)
+++ chrome/browser/automation/automation_provider_observers.cc (working copy)
@@ -16,6 +16,7 @@
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/threading/thread_restrictions.h"
+#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/automation/automation_provider.h"
@@ -1376,7 +1377,8 @@
received_width_(false) {}
void PageSnapshotTaker::Start() {
- ExecuteScript(L"window.domAutomationController.send(document.width);");
+ ExecuteScript(
+ ASCIIToUTF16("window.domAutomationController.send(document.width);"));
}
void PageSnapshotTaker::OnDomOperationCompleted(const std::string& json) {
@@ -1388,7 +1390,8 @@
received_width_ = true;
entire_page_size_.set_width(dimension);
- ExecuteScript(L"window.domAutomationController.send(document.height);");
+ ExecuteScript(
+ ASCIIToUTF16("window.domAutomationController.send(document.height);"));
} else {
entire_page_size_.set_height(dimension);
@@ -1415,15 +1418,17 @@
SendMessage(bytes_written == static_cast<int>(png_data.size()));
}
-void PageSnapshotTaker::ExecuteScript(const std::wstring& javascript) {
- std::wstring set_automation_id;
+void PageSnapshotTaker::ExecuteScript(const string16& javascript) {
+ std::string set_automation_id;
base::SStringPrintf(
&set_automation_id,
- L"window.domAutomationController.setAutomationId(%d);",
+ "window.domAutomationController.setAutomationId(%d);",
reply_message_->routing_id());
- render_view_->ExecuteJavascriptInWebFrame(L"", set_automation_id);
- render_view_->ExecuteJavascriptInWebFrame(L"", javascript);
+ render_view_->ExecuteJavascriptInWebFrame(string16(),
+ UTF8ToUTF16(set_automation_id));
+ render_view_->ExecuteJavascriptInWebFrame(string16(),
+ javascript);
}
void PageSnapshotTaker::SendMessage(bool success) {

Powered by Google App Engine
This is Rietveld 408576698