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

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

Issue 8549031: base::Bind: Convert PrintingContext::PrintSettingsCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win fix. Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/printing/print_dialog_gtk.cc ('k') | printing/print_dialog_gtk_interface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/print_job_worker.h" 5 #include "chrome/browser/printing/print_job_worker.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/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 result)); 178 result));
179 } 179 }
180 180
181 void PrintJobWorker::GetSettingsWithUI(gfx::NativeView parent_view, 181 void PrintJobWorker::GetSettingsWithUI(gfx::NativeView parent_view,
182 int document_page_count, 182 int document_page_count,
183 bool has_selection) { 183 bool has_selection) {
184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
185 185
186 printing_context_->AskUserForSettings( 186 printing_context_->AskUserForSettings(
187 parent_view, document_page_count, has_selection, 187 parent_view, document_page_count, has_selection,
188 NewCallback(this, &PrintJobWorker::GetSettingsWithUIDone)); 188 base::Bind(&PrintJobWorker::GetSettingsWithUIDone,
189 base::Unretained(this)));
189 } 190 }
190 191
191 void PrintJobWorker::GetSettingsWithUIDone(PrintingContext::Result result) { 192 void PrintJobWorker::GetSettingsWithUIDone(PrintingContext::Result result) {
192 message_loop()->PostTask( 193 message_loop()->PostTask(
193 FROM_HERE, 194 FROM_HERE,
194 base::Bind(&HoldRefCallback, make_scoped_refptr(owner_), 195 base::Bind(&HoldRefCallback, make_scoped_refptr(owner_),
195 base::Bind(&PrintJobWorker::GetSettingsDone, 196 base::Bind(&PrintJobWorker::GetSettingsDone,
196 base::Unretained(this), result))); 197 base::Unretained(this), result)));
197 } 198 }
198 199
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 NULL); 367 NULL);
367 owner_->message_loop()->PostTask(FROM_HERE, task); 368 owner_->message_loop()->PostTask(FROM_HERE, task);
368 Cancel(); 369 Cancel();
369 370
370 // Makes sure the variables are reinitialized. 371 // Makes sure the variables are reinitialized.
371 document_ = NULL; 372 document_ = NULL;
372 page_number_ = PageNumber::npos(); 373 page_number_ = PageNumber::npos();
373 } 374 }
374 375
375 } // namespace printing 376 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_dialog_gtk.cc ('k') | printing/print_dialog_gtk_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698