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

Unified Diff: components/gcm_driver/gcm_driver_desktop.cc

Issue 378643002: [GCM] Check-in with signed in accounts associates device to user (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing compilation issue on android Created 6 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 side-by-side diff with in-line comments
Download patch
Index: components/gcm_driver/gcm_driver_desktop.cc
diff --git a/components/gcm_driver/gcm_driver_desktop.cc b/components/gcm_driver/gcm_driver_desktop.cc
index 61f9cb122998ac50b7756d9f74e4d22085bec9ab..ce07eebeb301a213b34a82417d6449837cf1b6fe 100644
--- a/components/gcm_driver/gcm_driver_desktop.cc
+++ b/components/gcm_driver/gcm_driver_desktop.cc
@@ -132,6 +132,10 @@ class GCMDriverDesktop::IOWorker : public GCMClient::Delegate {
void GetGCMStatistics(bool clear_logs);
void SetGCMRecording(bool recording);
+ void SetAccountsForCheckin(
+ const std::map<std::string, std::string>& account_tokens,
+ bool account_removed);
+
// For testing purpose. Can be called from UI thread. Use with care.
GCMClient* gcm_client_for_testing() const { return gcm_client_.get(); }
@@ -345,6 +349,15 @@ void GCMDriverDesktop::IOWorker::SetGCMRecording(bool recording) {
base::Bind(&GCMDriverDesktop::GetGCMStatisticsFinished, service_, stats));
}
+void GCMDriverDesktop::IOWorker::SetAccountsForCheckin(
+ const std::map<std::string, std::string>& account_tokens,
+ bool account_removed) {
+ DCHECK(io_thread_->RunsTasksOnCurrentThread());
+
+ if (gcm_client_.get())
+ gcm_client_->SetAccountsForCheckin(account_tokens, account_removed);
+}
+
GCMDriverDesktop::GCMDriverDesktop(
scoped_ptr<GCMClientFactory> gcm_client_factory,
const GCMClient::ChromeBuildInfo& chrome_build_info,
@@ -581,6 +594,19 @@ void GCMDriverDesktop::SetGCMRecording(const GetGCMStatisticsCallback& callback,
recording));
}
+void GCMDriverDesktop::SetAccountsForCheckin(
+ const std::map<std::string, std::string>& account_tokens,
+ bool account_removed) {
+ DCHECK(ui_thread_->RunsTasksOnCurrentThread());
+
+ io_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&GCMDriverDesktop::IOWorker::SetAccountsForCheckin,
+ base::Unretained(io_worker_.get()),
+ account_tokens,
+ account_removed));
+}
+
GCMClient::Result GCMDriverDesktop::EnsureStarted() {
DCHECK(ui_thread_->RunsTasksOnCurrentThread());

Powered by Google App Engine
This is Rietveld 408576698