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

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

Issue 10483006: Print support for Windows Metro... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to ToT... Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 9 #include "base/message_loop.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 const base::Closure& callback) { 93 const base::Closure& callback) {
94 StartWorker(callback); 94 StartWorker(callback);
95 95
96 worker_->message_loop()->PostTask( 96 worker_->message_loop()->PostTask(
97 FROM_HERE, 97 FROM_HERE,
98 base::Bind(&PrintJobWorker::SetSettings, 98 base::Bind(&PrintJobWorker::SetSettings,
99 base::Unretained(worker_.get()), 99 base::Unretained(worker_.get()),
100 new_settings.DeepCopy())); 100 new_settings.DeepCopy()));
101 } 101 }
102 102
103 void PrinterQuery::SetWorkerDestination(
104 PrintDestinationInterface* destination) {
105 worker_->SetPrintDestination(destination);
106 }
107
103 void PrinterQuery::StartWorker(const base::Closure& callback) { 108 void PrinterQuery::StartWorker(const base::Closure& callback) {
104 DCHECK(callback_.is_null()); 109 DCHECK(callback_.is_null());
105 DCHECK(worker_.get()); 110 DCHECK(worker_.get());
106 111
107 // Lazily create the worker thread. There is one worker thread per print job. 112 // Lazily create the worker thread. There is one worker thread per print job.
108 if (!worker_->message_loop()) 113 if (!worker_->message_loop())
109 worker_->Start(); 114 worker_->Start();
110 115
111 callback_ = callback; 116 callback_ = callback;
112 } 117 }
(...skipping 11 matching lines...) Expand all
124 129
125 bool PrinterQuery::is_callback_pending() const { 130 bool PrinterQuery::is_callback_pending() const {
126 return !callback_.is_null(); 131 return !callback_.is_null();
127 } 132 }
128 133
129 bool PrinterQuery::is_valid() const { 134 bool PrinterQuery::is_valid() const {
130 return worker_.get() != NULL; 135 return worker_.get() != NULL;
131 } 136 }
132 137
133 } // namespace printing 138 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/printer_query.h ('k') | chrome/browser/printing/printing_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698