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

Side by Side Diff: chrome/renderer/pepper/ppb_pdf_impl.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: Added DCHECK to RequestPrintPreview(). 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 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 "chrome/renderer/pepper/ppb_pdf_impl.h" 5 #include "chrome/renderer/pepper/ppb_pdf_impl.h"
6 6
7 #include "base/files/scoped_file.h" 7 #include "base/files/scoped_file.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 // static 453 // static
454 const PPB_PDF* PPB_PDF_Impl::GetInterface() { return &ppb_pdf; } 454 const PPB_PDF* PPB_PDF_Impl::GetInterface() { return &ppb_pdf; }
455 455
456 // static 456 // static
457 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { 457 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) {
458 #if defined(ENABLE_FULL_PRINTING) 458 #if defined(ENABLE_FULL_PRINTING)
459 blink::WebElement element = GetWebElement(instance_id); 459 blink::WebElement element = GetWebElement(instance_id);
460 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element); 460 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element);
461 if (helper) 461 if (helper)
462 helper->PrintNode(element); 462 helper->PrintNode(element);
463
464 // DidStopLoading() is not call anywhere. Calling it here fixes a problem
465 // where PrintWebViewHelper() is waiting for DidStopLoading to be called to
466 // progress the preview process.
467 DidStopLoading(instance_id);
ivandavid 2014/08/14 03:38:13 Is this an appropriate place to place DidStopLoadi
Vitaly Buka (NO REVIEWS) 2014/08/14 05:19:43 It does not look like a right place let's remove t
463 #endif // ENABLE_FULL_PRINTING 468 #endif // ENABLE_FULL_PRINTING
464 } 469 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/printing/print_web_view_helper.h » ('j') | chrome/renderer/printing/print_web_view_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698