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

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

Issue 2773003002: Make the WebWidgetClient parameter a ref so it's not legal to pass a nullptr. (Closed)
Patch Set: WebViewClient dtor now overrides the virtual dtor in WebWidgetClient. Created 3 years, 8 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/shell/test_runner/web_view_test_client.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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(nullptr, 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::WebWidgetClient web_widget_client;
593 blink::WebFrameWidget::create(&web_widget_client, web_view, frame);
593 594
594 base::Value html(ResourceBundle::GetSharedInstance().GetLocalizedString( 595 base::Value html(ResourceBundle::GetSharedInstance().GetLocalizedString(
595 IDR_PRINT_PREVIEW_PAGE)); 596 IDR_PRINT_PREVIEW_PAGE));
596 // Load page with script to avoid async operations. 597 // Load page with script to avoid async operations.
597 ExecuteScript(frame, kPageLoadScriptFormat, html); 598 ExecuteScript(frame, kPageLoadScriptFormat, html);
598 599
599 std::unique_ptr<base::DictionaryValue> options(new base::DictionaryValue()); 600 std::unique_ptr<base::DictionaryValue> options(new base::DictionaryValue());
600 options.reset(new base::DictionaryValue()); 601 options.reset(new base::DictionaryValue());
601 options->SetDouble(kSettingHeaderFooterDate, base::Time::Now().ToJsTime()); 602 options->SetDouble(kSettingHeaderFooterDate, base::Time::Now().ToJsTime());
602 options->SetDouble("width", page_size.width); 603 options->SetDouble("width", page_size.width);
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 blink::WebConsoleMessage::LevelWarning, message)); 2369 blink::WebConsoleMessage::LevelWarning, message));
2369 return false; 2370 return false;
2370 } 2371 }
2371 2372
2372 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2373 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2373 // Reset counter on successful print. 2374 // Reset counter on successful print.
2374 count_ = 0; 2375 count_ = 0;
2375 } 2376 }
2376 2377
2377 } // namespace printing 2378 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | content/shell/test_runner/web_view_test_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698