Retrieve chrome build info in GCMProfileService, instead of GCMDriver
Since GCMDriver is going to be moved into component, it cannot access
chrome build info. So we now let GCMProfileService retrieve and pass
it.
Also change to define build info in GCMClient, instead of relying on
the one defined in proto buffer generated file.
BUG=356716
TEST=existing tests
Patch
Review URL: https://codereview.chromium.org/293053014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272453 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/google_apis/gcm/gcm_client.h b/google_apis/gcm/gcm_client.h
index 178b18f1..02111c8 100644
--- a/google_apis/gcm/gcm_client.h
+++ b/google_apis/gcm/gcm_client.h
@@ -20,10 +20,6 @@
class SequencedTaskRunner;
}
-namespace checkin_proto {
-class ChromeBuildProto;
-}
-
namespace net {
class URLRequestContextGetter;
}
@@ -58,6 +54,33 @@
UNKNOWN_ERROR
};
+ enum ChromePlatform {
+ PLATFORM_WIN,
+ PLATFORM_MAC,
+ PLATFORM_LINUX,
+ PLATFORM_CROS,
+ PLATFORM_IOS,
+ PLATFORM_ANDROID,
+ PLATFORM_UNKNOWN
+ };
+
+ enum ChromeChannel {
+ CHANNEL_STABLE,
+ CHANNEL_BETA,
+ CHANNEL_DEV,
+ CHANNEL_CANARY,
+ CHANNEL_UNKNOWN
+ };
+
+ struct GCM_EXPORT ChromeBuildInfo {
+ ChromeBuildInfo();
+ ~ChromeBuildInfo();
+
+ ChromePlatform platform;
+ ChromeChannel channel;
+ std::string version;
+ };
+
// Message data consisting of key-value pairs.
typedef std::map<std::string, std::string> MessageData;
@@ -173,7 +196,7 @@
// Begins initialization of the GCM Client. This will not trigger a
// connection.
- // |chrome_build_proto|: chrome info, i.e., version, channel and etc.
+ // |chrome_build_info|: chrome info, i.e., version, channel and etc.
// |store_path|: path to the GCM store.
// |account_ids|: account IDs to be related to the device when checking in.
// |blocking_task_runner|: for running blocking file tasks.
@@ -181,7 +204,7 @@
// |delegate|: the delegate whose methods will be called asynchronously in
// response to events and messages.
virtual void Initialize(
- const checkin_proto::ChromeBuildProto& chrome_build_proto,
+ const ChromeBuildInfo& chrome_build_info,
const base::FilePath& store_path,
const std::vector<std::string>& account_ids,
const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,