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

Unified Diff: components/gcm_driver/gcm_driver_desktop.h

Issue 561943002: Reland: Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrOS test failures 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/gcm_driver/gcm_channel_status_syncer.cc ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_driver_desktop.h
diff --git a/components/gcm_driver/gcm_driver_desktop.h b/components/gcm_driver/gcm_driver_desktop.h
index 51a98458a7e1e4dd43138ab20f11369a1db1e5d6..0ef949546fc0f6eda81afe1a65c0e739e3511299 100644
--- a/components/gcm_driver/gcm_driver_desktop.h
+++ b/components/gcm_driver/gcm_driver_desktop.h
@@ -15,10 +15,13 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "components/gcm_driver/gcm_channel_status_syncer.h"
#include "components/gcm_driver/gcm_client.h"
#include "components/gcm_driver/gcm_connection_observer.h"
#include "components/gcm_driver/gcm_driver.h"
+class PrefService;
+
namespace base {
class FilePath;
class SequencedTaskRunner;
@@ -44,6 +47,7 @@ class GCMDriverDesktop : public GCMDriver {
GCMDriverDesktop(
scoped_ptr<GCMClientFactory> gcm_client_factory,
const GCMClient::ChromeBuildInfo& chrome_build_info,
+ PrefService* prefs,
const base::FilePath& store_path,
const scoped_refptr<net::URLRequestContextGetter>& request_context,
const scoped_refptr<base::SequencedTaskRunner>& ui_thread,
@@ -84,6 +88,12 @@ class GCMDriverDesktop : public GCMDriver {
void SetAccountsForCheckin(
const std::map<std::string, std::string>& account_tokens);
+ // Exposed for testing purpose.
+ bool gcm_enabled() const { return gcm_enabled_; }
+ GCMChannelStatusSyncer* gcm_channel_status_syncer_for_testing() {
+ return gcm_channel_status_syncer_.get();
+ }
+
protected:
// GCMDriver implementation:
virtual GCMClient::Result EnsureStarted() OVERRIDE;
@@ -125,6 +135,8 @@ class GCMDriverDesktop : public GCMDriver {
void GetGCMStatisticsFinished(const GCMClient::GCMStatistics& stats);
+ scoped_ptr<GCMChannelStatusSyncer> gcm_channel_status_syncer_;
+
// Flag to indicate whether the user is signed in to a GAIA account.
// TODO(jianli): To be removed when sign-in enforcement is dropped.
bool signed_in_;
@@ -133,6 +145,7 @@ class GCMDriverDesktop : public GCMDriver {
bool gcm_started_;
// Flag to indicate if GCM is enabled.
+ // TODO(jianli): Removed when we switch completely to support all users.
bool gcm_enabled_;
// Flag to indicate the last known state of the GCM client. Because this
« no previous file with comments | « components/gcm_driver/gcm_channel_status_syncer.cc ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698