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

Side by Side Diff: components/gcm_driver/gcm_driver_desktop.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_
6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 virtual ~GCMDriverDesktop(); 49 virtual ~GCMDriverDesktop();
50 50
51 // GCMDriver overrides: 51 // GCMDriver overrides:
52 virtual void Shutdown() OVERRIDE; 52 virtual void Shutdown() OVERRIDE;
53 virtual void OnSignedIn() OVERRIDE; 53 virtual void OnSignedIn() OVERRIDE;
54 virtual void Purge() OVERRIDE; 54 virtual void Purge() OVERRIDE;
55 virtual void AddAppHandler(const std::string& app_id, 55 virtual void AddAppHandler(const std::string& app_id,
56 GCMAppHandler* handler) OVERRIDE; 56 GCMAppHandler* handler) OVERRIDE;
57 virtual void RemoveAppHandler(const std::string& app_id) OVERRIDE; 57 virtual void RemoveAppHandler(const std::string& app_id) OVERRIDE;
58 58
59 // GCMDriver implementation: 59 // GCMDriver implementation:
Nicolas Zea 2014/07/10 20:57:32 should these two sections be combined (this and th
fgorski 2014/07/11 22:51:21 Done.
60 virtual void Enable() OVERRIDE; 60 virtual void Enable() OVERRIDE;
61 virtual void Disable() OVERRIDE; 61 virtual void Disable() OVERRIDE;
62 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE; 62 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE;
63 virtual bool IsStarted() const OVERRIDE; 63 virtual bool IsStarted() const OVERRIDE;
64 virtual bool IsConnected() const OVERRIDE; 64 virtual bool IsConnected() const OVERRIDE;
65 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, 65 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback,
66 bool clear_logs) OVERRIDE; 66 bool clear_logs) OVERRIDE;
67 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, 67 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback,
68 bool recording) OVERRIDE; 68 bool recording) OVERRIDE;
69 69
70 // GCMDriverDesktop specific implementation.
71 // Sets a list of accounts with OAuth2 tokens for the next checkin.
72 // |account_tokens| maps email addresses to OAuth2 access tokens.
73 // |account_removed| indicates that an account has been removed since the
74 // last time the callback was called, which triggers an immediate checkin,
75 // to ensure that association between device and account is removed.
76 void SetAccountsForCheckin(
77 const std::map<std::string, std::string>& account_tokens,
78 bool account_removed);
Nicolas Zea 2014/07/10 20:57:32 nit: style guide prefers using an enum to a bool i
fgorski 2014/07/11 22:51:21 Done.
79
70 protected: 80 protected:
71 // GCMDriver implementation: 81 // GCMDriver implementation:
72 virtual GCMClient::Result EnsureStarted() OVERRIDE; 82 virtual GCMClient::Result EnsureStarted() OVERRIDE;
73 virtual void RegisterImpl( 83 virtual void RegisterImpl(
74 const std::string& app_id, 84 const std::string& app_id,
75 const std::vector<std::string>& sender_ids) OVERRIDE; 85 const std::vector<std::string>& sender_ids) OVERRIDE;
76 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE; 86 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE;
77 virtual void SendImpl(const std::string& app_id, 87 virtual void SendImpl(const std::string& app_id,
78 const std::string& receiver_id, 88 const std::string& receiver_id,
79 const GCMClient::OutgoingMessage& message) OVERRIDE; 89 const GCMClient::OutgoingMessage& message) OVERRIDE;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 146
137 // Used to pass a weak pointer to the IO worker. 147 // Used to pass a weak pointer to the IO worker.
138 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_; 148 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_;
139 149
140 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop); 150 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop);
141 }; 151 };
142 152
143 } // namespace gcm 153 } // namespace gcm
144 154
145 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ 155 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698