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

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

Issue 2738133002: Provide an overload to WebView::create that does not require a WebViewClient. (Closed)
Patch Set: Add a derived WebViewClient and use it when no client is passed. Created 3 years, 9 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 | « no previous file | content/renderer/media/android/media_info_loader_unittest.cc » ('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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 const PrintMsg_Print_Params& params) { 575 const PrintMsg_Print_Params& params) {
576 cc::PaintCanvasAutoRestore auto_restore(canvas, true); 576 cc::PaintCanvasAutoRestore auto_restore(canvas, true);
577 canvas->scale(1 / webkit_scale_factor, 1 / webkit_scale_factor); 577 canvas->scale(1 / webkit_scale_factor, 1 / webkit_scale_factor);
578 578
579 blink::WebSize page_size(page_layout.margin_left + page_layout.margin_right + 579 blink::WebSize page_size(page_layout.margin_left + page_layout.margin_right +
580 page_layout.content_width, 580 page_layout.content_width,
581 page_layout.margin_top + page_layout.margin_bottom + 581 page_layout.margin_top + page_layout.margin_bottom +
582 page_layout.content_height); 582 page_layout.content_height);
583 583
584 blink::WebView* web_view = 584 blink::WebView* web_view =
585 blink::WebView::create(nullptr, blink::WebPageVisibilityStateVisible); 585 blink::WebView::create(blink::WebPageVisibilityStateVisible);
586 web_view->settings()->setJavaScriptEnabled(true); 586 web_view->settings()->setJavaScriptEnabled(true);
587 587
588 blink::WebFrameClient frame_client; 588 blink::WebFrameClient frame_client;
589 blink::WebLocalFrame* frame = blink::WebLocalFrame::create( 589 blink::WebLocalFrame* frame = blink::WebLocalFrame::create(
590 blink::WebTreeScopeType::Document, &frame_client, nullptr, nullptr); 590 blink::WebTreeScopeType::Document, &frame_client, nullptr, nullptr);
591 web_view->setMainFrame(frame); 591 web_view->setMainFrame(frame);
592 blink::WebFrameWidget::create(nullptr, web_view, frame); 592 blink::WebFrameWidget::create(nullptr, web_view, frame);
593 593
594 base::Value html(ResourceBundle::GetSharedInstance().GetLocalizedString( 594 base::Value html(ResourceBundle::GetSharedInstance().GetLocalizedString(
595 IDR_PRINT_PREVIEW_PAGE)); 595 IDR_PRINT_PREVIEW_PAGE));
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 blink::WebConsoleMessage::LevelWarning, message)); 2368 blink::WebConsoleMessage::LevelWarning, message));
2369 return false; 2369 return false;
2370 } 2370 }
2371 2371
2372 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2372 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2373 // Reset counter on successful print. 2373 // Reset counter on successful print.
2374 count_ = 0; 2374 count_ = 0;
2375 } 2375 }
2376 2376
2377 } // namespace printing 2377 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/android/media_info_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698