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

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

Issue 445683003: [GCM] Exposing persistence of account mappings in GCM Driver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates based on self review Created 6 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 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_FAKE_GCM_DRIVER_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_
6 #define COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_ 6 #define COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "components/gcm_driver/gcm_driver.h" 10 #include "components/gcm_driver/gcm_driver.h"
11 11
12 namespace gcm { 12 namespace gcm {
13 13
14 class FakeGCMDriver : public GCMDriver { 14 class FakeGCMDriver : public GCMDriver {
15 public: 15 public:
16 FakeGCMDriver(); 16 FakeGCMDriver();
17 virtual ~FakeGCMDriver(); 17 virtual ~FakeGCMDriver();
18 18
19 // GCMDriver overrides: 19 // GCMDriver overrides:
20 virtual void Shutdown() OVERRIDE; 20 virtual void Shutdown() OVERRIDE;
21 virtual void AddAppHandler(const std::string& app_id, 21 virtual void AddAppHandler(const std::string& app_id,
22 GCMAppHandler* handler) OVERRIDE; 22 GCMAppHandler* handler) OVERRIDE;
23 virtual void RemoveAppHandler(const std::string& app_id) OVERRIDE; 23 virtual void RemoveAppHandler(const std::string& app_id) OVERRIDE;
24
25 // GCMDriver implementation:
26 virtual void OnSignedIn() OVERRIDE; 24 virtual void OnSignedIn() OVERRIDE;
27 virtual void Purge() OVERRIDE; 25 virtual void Purge() OVERRIDE;
28 virtual void Enable() OVERRIDE; 26 virtual void Enable() OVERRIDE;
29 virtual void Disable() OVERRIDE; 27 virtual void Disable() OVERRIDE;
30 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE; 28 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE;
31 virtual bool IsStarted() const OVERRIDE; 29 virtual bool IsStarted() const OVERRIDE;
32 virtual bool IsConnected() const OVERRIDE; 30 virtual bool IsConnected() const OVERRIDE;
33 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, 31 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback,
34 bool clear_logs) OVERRIDE; 32 bool clear_logs) OVERRIDE;
35 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, 33 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback,
36 bool recording) OVERRIDE; 34 bool recording) OVERRIDE;
35 virtual void UpdateAccountMapping(
36 const AccountMapping& account_mapping) OVERRIDE;
37 virtual void RemoveAccountMapping(const std::string& account_id) OVERRIDE;
37 38
38 protected: 39 protected:
39 // GCMDriver implementation: 40 // GCMDriver implementation:
40 virtual GCMClient::Result EnsureStarted() OVERRIDE; 41 virtual GCMClient::Result EnsureStarted() OVERRIDE;
41 virtual void RegisterImpl( 42 virtual void RegisterImpl(
42 const std::string& app_id, 43 const std::string& app_id,
43 const std::vector<std::string>& sender_ids) OVERRIDE; 44 const std::vector<std::string>& sender_ids) OVERRIDE;
44 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE; 45 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE;
45 virtual void SendImpl(const std::string& app_id, 46 virtual void SendImpl(const std::string& app_id,
46 const std::string& receiver_id, 47 const std::string& receiver_id,
47 const GCMClient::OutgoingMessage& message) OVERRIDE; 48 const GCMClient::OutgoingMessage& message) OVERRIDE;
48 49
49 private: 50 private:
50 DISALLOW_COPY_AND_ASSIGN(FakeGCMDriver); 51 DISALLOW_COPY_AND_ASSIGN(FakeGCMDriver);
51 }; 52 };
52 53
53 } // namespace gcm 54 } // namespace gcm
54 55
55 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_ 56 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698