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

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

Issue 858363002: OOP PDF: Override printing for MimeHandlerViewContainers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mime-handler-api-simpler
Patch Set: Created 5 years, 11 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 <string> 7 #include <string>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 bool user_initiated) { 836 bool user_initiated) {
837 DCHECK(frame); 837 DCHECK(frame);
838 838
839 // Allow Prerendering to cancel this print request if necessary. 839 // Allow Prerendering to cancel this print request if necessary.
840 if (delegate_->CancelPrerender(render_view(), routing_id())) 840 if (delegate_->CancelPrerender(render_view(), routing_id()))
841 return; 841 return;
842 842
843 if (!IsScriptInitiatedPrintAllowed(frame, user_initiated)) 843 if (!IsScriptInitiatedPrintAllowed(frame, user_initiated))
844 return; 844 return;
845 845
846 if (delegate_->OverridePrint(frame))
847 return;
848
846 if (!g_is_preview_enabled_) { 849 if (!g_is_preview_enabled_) {
847 Print(frame, blink::WebNode(), true); 850 Print(frame, blink::WebNode(), true);
848 } else { 851 } else {
849 print_preview_context_.InitWithFrame(frame); 852 print_preview_context_.InitWithFrame(frame);
850 RequestPrintPreview(PRINT_PREVIEW_SCRIPTED); 853 RequestPrintPreview(PRINT_PREVIEW_SCRIPTED);
851 } 854 }
852 } 855 }
853 856
854 bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) { 857 bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
855 bool handled = true; 858 bool handled = true;
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
2043 blink::WebConsoleMessage::LevelWarning, message)); 2046 blink::WebConsoleMessage::LevelWarning, message));
2044 return false; 2047 return false;
2045 } 2048 }
2046 2049
2047 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2050 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2048 // Reset counter on successful print. 2051 // Reset counter on successful print.
2049 count_ = 0; 2052 count_ = 0;
2050 } 2053 }
2051 2054
2052 } // namespace printing 2055 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698