OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ |
6 #define CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ | 6 #define CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
23 typedef base::Callback<void(const std::string&)> UnregisterCallback; | 23 typedef base::Callback<void(const std::string&)> UnregisterCallback; |
24 | 24 |
25 // Helper function to be used with | 25 // Helper function to be used with |
26 // KeyedService::SetTestingFactory(). | 26 // KeyedService::SetTestingFactory(). |
27 static KeyedService* Build(content::BrowserContext* context); | 27 static KeyedService* Build(content::BrowserContext* context); |
28 | 28 |
29 explicit FakeGCMProfileService(Profile* profile); | 29 explicit FakeGCMProfileService(Profile* profile); |
30 ~FakeGCMProfileService() override; | 30 ~FakeGCMProfileService() override; |
31 | 31 |
| 32 FakeGCMProfileService* AsFakeGCMProfileService() override; |
| 33 |
32 void RegisterFinished(const std::string& app_id, | 34 void RegisterFinished(const std::string& app_id, |
33 const std::vector<std::string>& sender_ids); | 35 const std::vector<std::string>& sender_ids); |
34 void UnregisterFinished(const std::string& app_id); | 36 void UnregisterFinished(const std::string& app_id); |
35 void SendFinished(const std::string& app_id, | 37 void SendFinished(const std::string& app_id, |
36 const std::string& receiver_id, | 38 const std::string& receiver_id, |
37 const GCMClient::OutgoingMessage& message); | 39 const GCMClient::OutgoingMessage& message); |
38 | 40 |
39 void AddExpectedUnregisterResponse(GCMClient::Result result); | 41 void AddExpectedUnregisterResponse(GCMClient::Result result); |
40 | 42 |
41 void SetUnregisterCallback(const UnregisterCallback& callback); | 43 void SetUnregisterCallback(const UnregisterCallback& callback); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 GCMClient::OutgoingMessage last_sent_message_; | 75 GCMClient::OutgoingMessage last_sent_message_; |
74 std::string last_receiver_id_; | 76 std::string last_receiver_id_; |
75 UnregisterCallback unregister_callback_; | 77 UnregisterCallback unregister_callback_; |
76 | 78 |
77 DISALLOW_COPY_AND_ASSIGN(FakeGCMProfileService); | 79 DISALLOW_COPY_AND_ASSIGN(FakeGCMProfileService); |
78 }; | 80 }; |
79 | 81 |
80 } // namespace gcm | 82 } // namespace gcm |
81 | 83 |
82 #endif // CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ | 84 #endif // CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_ |
OLD | NEW |