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

Unified Diff: chrome/browser/chromeos/policy/heartbeat_scheduler.h

Issue 1258313002: Send GCM id to DMServer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adopt upstream protobuf changes Created 5 years, 4 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: chrome/browser/chromeos/policy/heartbeat_scheduler.h
diff --git a/chrome/browser/chromeos/policy/heartbeat_scheduler.h b/chrome/browser/chromeos/policy/heartbeat_scheduler.h
index 9c268fa482f212397a3312785312d8bfe34d0cdf..ab3140c612890872b28884fd7df1162ebe028345 100644
--- a/chrome/browser/chromeos/policy/heartbeat_scheduler.h
+++ b/chrome/browser/chromeos/policy/heartbeat_scheduler.h
@@ -16,6 +16,7 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "components/gcm_driver/gcm_app_handler.h"
#include "components/gcm_driver/gcm_client.h"
+#include "components/policy/core/common/cloud/cloud_policy_client.h"
namespace base {
class SequencedTaskRunner;
@@ -37,9 +38,11 @@ class HeartbeatScheduler : public gcm::GCMAppHandler {
// Default interval for how often we send up a heartbeat.
static const int64 kDefaultHeartbeatIntervalMs;
- // Constructor. |driver| can be null for tests.
+ // Constructor. |cloud_policy_client| will be used to send registered GCM id
+ // to DM server, and can be null. |driver| can be null for tests.
HeartbeatScheduler(
gcm::GCMDriver* driver,
+ policy::CloudPolicyClient* cloud_policy_client,
const std::string& enrollment_domain,
const std::string& device_id,
const scoped_refptr<base::SequencedTaskRunner>& task_runner);
@@ -86,6 +89,9 @@ class HeartbeatScheduler : public gcm::GCMAppHandler {
// Shuts down our GCM connection (called when heartbeats are disabled).
void ShutdownGCM();
+ // Callback for the GCM id update request.
+ void OnGcmIdUpdateRequestSent(bool status);
+
// TaskRunner used for scheduling heartbeats.
const scoped_refptr<base::SequencedTaskRunner> task_runner_;
@@ -116,6 +122,8 @@ class HeartbeatScheduler : public gcm::GCMAppHandler {
// Callback invoked via a delay to send a heartbeat.
base::CancelableClosure heartbeat_callback_;
+ policy::CloudPolicyClient* cloud_policy_client_;
+
// The GCMDriver used to send heartbeat messages.
gcm::GCMDriver* const gcm_driver_;

Powered by Google App Engine
This is Rietveld 408576698