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

Unified Diff: chrome/renderer/render_view.cc

Issue 6274: Greasemonkey support. (Closed)
Patch Set: Created 12 years, 2 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/renderer/render_view.cc
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 4fe474d0ddf34a48a147bec9a62adc0d98cd32ce..c04b7d91d4eb6f3b72e36b58e6ebe39727249b32 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "v8/include/v8.h"
M-A Ruel 2008/10/06 17:30:44 You need this?
+
#include "base/command_line.h"
#include "base/gfx/bitmap_header.h"
#include "base/gfx/bitmap_platform_device_win.h"
@@ -2228,19 +2230,20 @@ WebFrame* RenderView::GetChildFrame(const std::wstring& frame_xpath) const {
return web_frame;
}
-void RenderView::EvaluateScriptUrl(const std::wstring& frame_xpath,
- const std::wstring& js_url) {
+void RenderView::EvaluateScript(const std::wstring& frame_xpath,
+ const std::wstring& script,
+ const std::wstring& filename) {
WebFrame* web_frame = GetChildFrame(frame_xpath);
if (!web_frame)
return;
- scoped_ptr<WebRequest> request(WebRequest::Create(GURL(js_url)));
- web_frame->LoadRequest(request.get());
+ web_frame->ExecuteJavaScript(script, filename);
}
void RenderView::OnScriptEvalRequest(const std::wstring& frame_xpath,
- const std::wstring& jscript) {
- EvaluateScriptUrl(frame_xpath, jscript);
+ const std::wstring& jscript,
+ const std::wstring& filename) {
+ EvaluateScript(frame_xpath, jscript, filename);
}
void RenderView::OnAddMessageToConsole(const std::wstring& frame_xpath,

Powered by Google App Engine
This is Rietveld 408576698