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

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: fix android compile and remove the test as it hits a probably dodgy assert 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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 bool user_initiated) { 822 bool user_initiated) {
823 DCHECK(frame); 823 DCHECK(frame);
824 824
825 // Allow Prerendering to cancel this print request if necessary. 825 // Allow Prerendering to cancel this print request if necessary.
826 if (delegate_->CancelPrerender(render_view(), routing_id())) 826 if (delegate_->CancelPrerender(render_view(), routing_id()))
827 return; 827 return;
828 828
829 if (!IsScriptInitiatedPrintAllowed(frame, user_initiated)) 829 if (!IsScriptInitiatedPrintAllowed(frame, user_initiated))
830 return; 830 return;
831 831
832 if (delegate_->OverridePrint(frame))
833 return;
834
832 if (!g_is_preview_enabled_) { 835 if (!g_is_preview_enabled_) {
833 Print(frame, blink::WebNode(), true); 836 Print(frame, blink::WebNode(), true);
834 } else { 837 } else {
835 print_preview_context_.InitWithFrame(frame); 838 print_preview_context_.InitWithFrame(frame);
836 RequestPrintPreview(PRINT_PREVIEW_SCRIPTED); 839 RequestPrintPreview(PRINT_PREVIEW_SCRIPTED);
837 } 840 }
838 } 841 }
839 842
840 bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) { 843 bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
841 bool handled = true; 844 bool handled = true;
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 blink::WebConsoleMessage::LevelWarning, message)); 2033 blink::WebConsoleMessage::LevelWarning, message));
2031 return false; 2034 return false;
2032 } 2035 }
2033 2036
2034 void PrintWebViewHelper::ScriptingThrottler::Reset() { 2037 void PrintWebViewHelper::ScriptingThrottler::Reset() {
2035 // Reset counter on successful print. 2038 // Reset counter on successful print.
2036 count_ = 0; 2039 count_ = 0;
2037 } 2040 }
2038 2041
2039 } // namespace printing 2042 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698