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

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

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase 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
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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::WebFrameWidget::create(nullptr, web_view, frame);
593 593
594 base::StringValue html(ResourceBundle::GetSharedInstance().GetLocalizedString( 594 base::Value html(ResourceBundle::GetSharedInstance().GetLocalizedString(
595 IDR_PRINT_PREVIEW_PAGE)); 595 IDR_PRINT_PREVIEW_PAGE));
596 // Load page with script to avoid async operations. 596 // Load page with script to avoid async operations.
597 ExecuteScript(frame, kPageLoadScriptFormat, html); 597 ExecuteScript(frame, kPageLoadScriptFormat, html);
598 598
599 std::unique_ptr<base::DictionaryValue> options(new base::DictionaryValue()); 599 std::unique_ptr<base::DictionaryValue> options(new base::DictionaryValue());
600 options.reset(new base::DictionaryValue()); 600 options.reset(new base::DictionaryValue());
601 options->SetDouble(kSettingHeaderFooterDate, base::Time::Now().ToJsTime()); 601 options->SetDouble(kSettingHeaderFooterDate, base::Time::Now().ToJsTime());
602 options->SetDouble("width", page_size.width); 602 options->SetDouble("width", page_size.width);
603 options->SetDouble("height", page_size.height); 603 options->SetDouble("height", page_size.height);
604 options->SetDouble("topMargin", page_layout.margin_top); 604 options->SetDouble("topMargin", page_layout.margin_top);
(...skipping 1763 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 | « components/prefs/testing_pref_store.cc ('k') | components/proximity_auth/webui/proximity_auth_webui_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698