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

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..de89aae7bc69b4e05c515c1c4f1b5db797b68b28 100644
--- a/chrome/browser/printing/printer_query.cc
+++ b/chrome/browser/printing/printer_query.cc
@@ -30,6 +30,12 @@ PrinterQuery::~PrinterQuery() {
void PrinterQuery::GetSettingsDone(const PrintSettings& new_settings,
PrintingContext::Result result) {
+
+ if (result == PrintingContext::TEST) {
+ LOG(INFO) << "DGN - GetSettingsDone - Received TEST";
+ return;
+ }
+
is_print_dialog_box_shown_ = false;
last_status_ = result;
if (result != PrintingContext::FAILED) {
@@ -42,11 +48,25 @@ 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";
+
callback_.Run();
callback_.Reset();
}
}
+void PrinterQuery::ShowSystemDialogDone(PrintingContext::Result result) {
+ LOG(INFO) << "DGN - ShowSystemDialogDone " << result;
+
+ if (!callback_.is_null()) {
+ // This may cause reentrancy like to call StopWorker().
+ callback_.Run();
+ callback_.Reset();
dgn 2014/11/25 17:07:42 callback reset here. I can't rely on something cal
+ }
+}
+
+
PrintJobWorker* PrinterQuery::DetachWorker(PrintJobWorkerOwner* new_owner) {
DCHECK(callback_.is_null());
DCHECK(worker_.get());
@@ -75,14 +95,15 @@ void PrinterQuery::GetSettings(
StartWorker(callback);
// Real work is done in PrintJobWorker::GetSettings().
- is_print_dialog_box_shown_ = ask_user_for_settings == ASK_USER;
worker_->PostTask(FROM_HERE,
base::Bind(&PrintJobWorker::GetSettings,
base::Unretained(worker_.get()),
- is_print_dialog_box_shown_,
+ ask_user_for_settings,
expected_page_count,
has_selection,
margin_type));
+
+
}
void PrinterQuery::SetSettings(scoped_ptr<base::DictionaryValue> new_settings,

Powered by Google App Engine
This is Rietveld 408576698