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

Side by Side Diff: chrome/browser/printing/printer_query.cc

Issue 524543002: Removed IDC_PRINT_TO_DESTINATION. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fri Aug 29 14:26:26 PDT 2014 Created 6 years, 3 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/browser/printing/printer_query.h" 5 #include "chrome/browser/printing/printer_query.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void PrinterQuery::SetSettings(scoped_ptr<base::DictionaryValue> new_settings, 88 void PrinterQuery::SetSettings(scoped_ptr<base::DictionaryValue> new_settings,
89 const base::Closure& callback) { 89 const base::Closure& callback) {
90 StartWorker(callback); 90 StartWorker(callback);
91 91
92 worker_->PostTask(FROM_HERE, 92 worker_->PostTask(FROM_HERE,
93 base::Bind(&PrintJobWorker::SetSettings, 93 base::Bind(&PrintJobWorker::SetSettings,
94 base::Unretained(worker_.get()), 94 base::Unretained(worker_.get()),
95 base::Passed(&new_settings))); 95 base::Passed(&new_settings)));
96 } 96 }
97 97
98 void PrinterQuery::SetWorkerDestination(
99 PrintDestinationInterface* destination) {
100 worker_->SetPrintDestination(destination);
101 }
102
103 void PrinterQuery::StartWorker(const base::Closure& callback) { 98 void PrinterQuery::StartWorker(const base::Closure& callback) {
104 DCHECK(callback_.is_null()); 99 DCHECK(callback_.is_null());
105 DCHECK(worker_.get()); 100 DCHECK(worker_.get());
106 101
107 // Lazily create the worker thread. There is one worker thread per print job. 102 // Lazily create the worker thread. There is one worker thread per print job.
108 if (!worker_->IsRunning()) 103 if (!worker_->IsRunning())
109 worker_->Start(); 104 worker_->Start();
110 105
111 callback_ = callback; 106 callback_ = callback;
112 } 107 }
(...skipping 11 matching lines...) Expand all
124 119
125 bool PrinterQuery::is_callback_pending() const { 120 bool PrinterQuery::is_callback_pending() const {
126 return !callback_.is_null(); 121 return !callback_.is_null();
127 } 122 }
128 123
129 bool PrinterQuery::is_valid() const { 124 bool PrinterQuery::is_valid() const {
130 return worker_.get() != NULL; 125 return worker_.get() != NULL;
131 } 126 }
132 127
133 } // namespace printing 128 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/printer_query.h ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698