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

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: Update to the code to prevent test crashes. 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner); 48 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner);
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
59 // GCMDriver implementation:
60 virtual void Enable() OVERRIDE; 58 virtual void Enable() OVERRIDE;
61 virtual void Disable() OVERRIDE; 59 virtual void Disable() OVERRIDE;
62 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE; 60 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE;
63 virtual bool IsStarted() const OVERRIDE; 61 virtual bool IsStarted() const OVERRIDE;
64 virtual bool IsConnected() const OVERRIDE; 62 virtual bool IsConnected() const OVERRIDE;
65 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, 63 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback,
66 bool clear_logs) OVERRIDE; 64 bool clear_logs) OVERRIDE;
67 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, 65 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback,
68 bool recording) OVERRIDE; 66 bool recording) OVERRIDE;
69 67
68 // GCMDriverDesktop specific implementation.
69 // Sets a list of accounts with OAuth2 tokens for the next checkin.
70 // |account_tokens| maps email addresses to OAuth2 access tokens.
71 // |account_removed| indicates that an account has been removed since the
72 // last time the callback was called, which triggers an immediate checkin,
73 // to ensure that association between device and account is removed.
74 void SetAccountsForCheckin(
75 const std::map<std::string, std::string>& account_tokens);
76
70 protected: 77 protected:
71 // GCMDriver implementation: 78 // GCMDriver implementation:
72 virtual GCMClient::Result EnsureStarted() OVERRIDE; 79 virtual GCMClient::Result EnsureStarted() OVERRIDE;
73 virtual void RegisterImpl( 80 virtual void RegisterImpl(
74 const std::string& app_id, 81 const std::string& app_id,
75 const std::vector<std::string>& sender_ids) OVERRIDE; 82 const std::vector<std::string>& sender_ids) OVERRIDE;
76 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE; 83 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE;
77 virtual void SendImpl(const std::string& app_id, 84 virtual void SendImpl(const std::string& app_id,
78 const std::string& receiver_id, 85 const std::string& receiver_id,
79 const GCMClient::OutgoingMessage& message) OVERRIDE; 86 const GCMClient::OutgoingMessage& message) OVERRIDE;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 143
137 // Used to pass a weak pointer to the IO worker. 144 // Used to pass a weak pointer to the IO worker.
138 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_; 145 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_;
139 146
140 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop); 147 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop);
141 }; 148 };
142 149
143 } // namespace gcm 150 } // namespace gcm
144 151
145 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ 152 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_client_impl_unittest.cc ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698