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

Unified Diff: chrome/browser/printing/printer_query.cc

Issue 740983002: Implement window.print() on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
Index: chrome/browser/printing/printer_query.cc
diff --git a/chrome/browser/printing/printer_query.cc b/chrome/browser/printing/printer_query.cc
index 6cd11ff067ef9537b1c6ee0131160c8eb8805b1d..80f936297cf479ee6e43e31d9324acabdeb8f78d 100644
--- a/chrome/browser/printing/printer_query.cc
+++ b/chrome/browser/printing/printer_query.cc
@@ -31,6 +31,7 @@ PrinterQuery::~PrinterQuery() {
void PrinterQuery::GetSettingsDone(const PrintSettings& new_settings,
PrintingContext::Result result) {
is_print_dialog_box_shown_ = false;
+ is_initiated_from_android_scripted_print_ = false;
last_status_ = result;
if (result != PrintingContext::FAILED) {
settings_ = new_settings;
@@ -42,11 +43,22 @@ void PrinterQuery::GetSettingsDone(const PrintSettings& new_settings,
if (!callback_.is_null()) {
// This may cause reentrancy like to call StopWorker().
+ LOG(INFO) << "DGN - GetSettingsDone - Calling PrinterQuery("
+ << cookie_ <<")'s stored callback";
+
+ if (is_initiated_from_android_scripted_print_) {
+ LOG(INFO) << " DGN - THAT'S MY PQ!";
dgn 2014/11/20 12:26:16 I never get there. That's the place where I expect
+ is_initiated_from_android_scripted_print_ = false;
+ }
callback_.Run();
callback_.Reset();
}
}
+void PrinterQuery::SetInitiatedFromAndroidScript() {
+ is_initiated_from_android_scripted_print_ = true;
+}
+
PrintJobWorker* PrinterQuery::DetachWorker(PrintJobWorkerOwner* new_owner) {
DCHECK(callback_.is_null());
DCHECK(worker_.get());

Powered by Google App Engine
This is Rietveld 408576698