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

Unified Diff: pdf/instance.cc

Issue 467343003: Defer request to print a PDF when the user initiates the entire frame and the PDF hasn't loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed DCHECK argument. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/instance.cc
diff --git a/pdf/instance.cc b/pdf/instance.cc
index 9cb78294b090980824760b2b3a51dddeb026c48e..cda0c588a665b6a7d9579fa1770681d27461581d 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -1499,6 +1499,12 @@ void Instance::DocumentLoadComplete(int page_count) {
DCHECK(document_load_state_ == LOAD_STATE_LOADING);
document_load_state_ = LOAD_STATE_COMPLETE;
UserMetricsRecordAction("PDF.LoadSuccess");
+
+ if (did_call_start_loading_) {
+ pp::PDF::DidStopLoading(this);
+ did_call_start_loading_ = false;
+ }
+
if (on_load_callback_.is_string())
ExecuteScript(on_load_callback_);
// Note: If we are in print preview mode on_load_callback_ might call
@@ -1515,11 +1521,6 @@ void Instance::DocumentLoadComplete(int page_count) {
if (!pp::PDF::IsAvailable())
return;
- if (did_call_start_loading_) {
- pp::PDF::DidStopLoading(this);
- did_call_start_loading_ = false;
- }
-
int content_restrictions =
CONTENT_RESTRICTION_CUT | CONTENT_RESTRICTION_PASTE;
if (!engine_->HasPermission(PDFEngine::PERMISSION_COPY))
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698