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

Unified Diff: chrome/service/cloud_print/cloud_print_connector.cc

Issue 8600007: base::Bind: Convert chrome/service/cloud_print. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and review fixes. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/service/cloud_print/cloud_print_auth.cc ('k') | chrome/service/cloud_print/print_system.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/cloud_print_connector.cc
diff --git a/chrome/service/cloud_print/cloud_print_connector.cc b/chrome/service/cloud_print/cloud_print_connector.cc
index a1675795066aad9ea2e48770b77c15f09c473460..a2b5f8134a8ef8269448d9e800e04f81d440e87d 100644
--- a/chrome/service/cloud_print/cloud_print_connector.cc
+++ b/chrome/service/cloud_print/cloud_print_connector.cc
@@ -4,6 +4,8 @@
#include "chrome/service/cloud_print/cloud_print_connector.h"
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/md5.h"
#include "base/rand_util.h"
#include "base/string_number_conversions.h"
@@ -380,8 +382,7 @@ void CloudPrintConnector::AddPendingTask(const PendingTask& task) {
// If this is the only pending task, we need to start the process.
if (pending_tasks_.size() == 1) {
MessageLoop::current()->PostTask(
- FROM_HERE, NewRunnableMethod(
- this, &CloudPrintConnector::ProcessPendingTask));
+ FROM_HERE, base::Bind(&CloudPrintConnector::ProcessPendingTask, this));
}
}
@@ -428,12 +429,12 @@ void CloudPrintConnector::OnPrinterRegister(
}
}
- cloud_print::PrintSystem::PrinterCapsAndDefaultsCallback* callback =
- NewCallback(this, &CloudPrintConnector::OnReceivePrinterCaps);
- // Asnchronously fetch the printer caps and defaults. The story will
+ // Asynchronously fetch the printer caps and defaults. The story will
// continue in OnReceivePrinterCaps.
print_system_->GetPrinterCapsAndDefaults(
- info.printer_name.c_str(), callback);
+ info.printer_name.c_str(),
+ base::Bind(&CloudPrintConnector::OnReceivePrinterCaps,
+ base::Unretained(this)));
}
void CloudPrintConnector::OnPrinterDelete(const std::string& printer_id) {
@@ -456,14 +457,13 @@ void CloudPrintConnector::OnPrinterDelete(const std::string& printer_id) {
void CloudPrintConnector::ContinuePendingTaskProcessing() {
if (pending_tasks_.size() == 0)
- return; // No peding tasks.
+ return; // No pending tasks.
- // Delete current task and repost if we have more task avaialble.
+ // Delete current task and repost if we have more task available.
pending_tasks_.pop_front();
if (pending_tasks_.size() != 0) {
MessageLoop::current()->PostTask(
- FROM_HERE, NewRunnableMethod(
- this, &CloudPrintConnector::ProcessPendingTask));
+ FROM_HERE, base::Bind(&CloudPrintConnector::ProcessPendingTask, this));
}
}
« no previous file with comments | « chrome/service/cloud_print/cloud_print_auth.cc ('k') | chrome/service/cloud_print/print_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698