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

Side by Side Diff: components/printing/renderer/print_web_view_helper.cc

Issue 2923433002: Move ExecuteScript method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Tweaked a comment in WebViewPlugin::WebViewHelper::main_frame [as suggested in CR feedback] Created 3 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
« no previous file with comments | « components/plugins/renderer/webview_plugin.cc ('k') | content/renderer/mojo_main_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/printing/renderer/print_web_view_helper.h" 5 #include "components/printing/renderer/print_web_view_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 bool g_is_preview_enabled = true; 92 bool g_is_preview_enabled = true;
93 #else 93 #else
94 bool g_is_preview_enabled = false; 94 bool g_is_preview_enabled = false;
95 #endif 95 #endif
96 96
97 const char kPageLoadScriptFormat[] = 97 const char kPageLoadScriptFormat[] =
98 "document.open(); document.write(%s); document.close();"; 98 "document.open(); document.write(%s); document.close();";
99 99
100 const char kPageSetupScriptFormat[] = "setup(%s);"; 100 const char kPageSetupScriptFormat[] = "setup(%s);";
101 101
102 void ExecuteScript(blink::WebFrame* frame, 102 void ExecuteScript(blink::WebLocalFrame* frame,
103 const char* script_format, 103 const char* script_format,
104 const base::Value& parameters) { 104 const base::Value& parameters) {
105 std::string json; 105 std::string json;
106 base::JSONWriter::Write(parameters, &json); 106 base::JSONWriter::Write(parameters, &json);
107 std::string script = base::StringPrintf(script_format, json.c_str()); 107 std::string script = base::StringPrintf(script_format, json.c_str());
108 frame->ExecuteScript(blink::WebString::FromUTF8(script)); 108 frame->ExecuteScript(blink::WebString::FromUTF8(script));
109 } 109 }
110 110
111 int GetDPI(const PrintMsg_Print_Params* print_params) { 111 int GetDPI(const PrintMsg_Print_Params* print_params) {
112 #if defined(OS_MACOSX) 112 #if defined(OS_MACOSX)
(...skipping 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 blink::WebConsoleMessage::kLevelWarning, message)); 2379 blink::WebConsoleMessage::kLevelWarning, message));
2380 return false; 2380 return false;
2381 } 2381 }
2382 2382
2383 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2383 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2384 // Reset counter on successful print. 2384 // Reset counter on successful print.
2385 count_ = 0; 2385 count_ = 0;
2386 } 2386 }
2387 2387
2388 } // namespace printing 2388 } // namespace printing
OLDNEW
« no previous file with comments | « components/plugins/renderer/webview_plugin.cc ('k') | content/renderer/mojo_main_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698