OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2407 | 2407 |
2408 return web_frame; | 2408 return web_frame; |
2409 } | 2409 } |
2410 | 2410 |
2411 void RenderView::EvaluateScript(const std::wstring& frame_xpath, | 2411 void RenderView::EvaluateScript(const std::wstring& frame_xpath, |
2412 const std::wstring& script) { | 2412 const std::wstring& script) { |
2413 WebFrame* web_frame = GetChildFrame(frame_xpath); | 2413 WebFrame* web_frame = GetChildFrame(frame_xpath); |
2414 if (!web_frame) | 2414 if (!web_frame) |
2415 return; | 2415 return; |
2416 | 2416 |
2417 web_frame->ExecuteJavaScript(WideToUTF8(script), GURL()); | 2417 web_frame->ExecuteJavaScript(WideToUTF8(script), |
| 2418 GURL(), // script url |
| 2419 1); // base line number |
2418 } | 2420 } |
2419 | 2421 |
2420 void RenderView::OnScriptEvalRequest(const std::wstring& frame_xpath, | 2422 void RenderView::OnScriptEvalRequest(const std::wstring& frame_xpath, |
2421 const std::wstring& jscript) { | 2423 const std::wstring& jscript) { |
2422 EvaluateScript(frame_xpath, jscript); | 2424 EvaluateScript(frame_xpath, jscript); |
2423 } | 2425 } |
2424 | 2426 |
2425 void RenderView::OnAddMessageToConsole(const std::wstring& frame_xpath, | 2427 void RenderView::OnAddMessageToConsole(const std::wstring& frame_xpath, |
2426 const std::wstring& msg, | 2428 const std::wstring& msg, |
2427 ConsoleMessageLevel level) { | 2429 ConsoleMessageLevel level) { |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2769 template_resource_id)); | 2771 template_resource_id)); |
2770 | 2772 |
2771 if (template_html.empty()) { | 2773 if (template_html.empty()) { |
2772 NOTREACHED() << "unable to load template. ID: " << template_resource_id; | 2774 NOTREACHED() << "unable to load template. ID: " << template_resource_id; |
2773 return ""; | 2775 return ""; |
2774 } | 2776 } |
2775 // "t" is the id of the templates root node. | 2777 // "t" is the id of the templates root node. |
2776 return jstemplate_builder::GetTemplateHtml( | 2778 return jstemplate_builder::GetTemplateHtml( |
2777 template_html, &error_strings, "t"); | 2779 template_html, &error_strings, "t"); |
2778 } | 2780 } |
OLD | NEW |