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 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" | 5 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "components/gcm/gcm_driver.h" | 11 #include "components/gcm/gcm_driver.h" |
12 | 12 |
13 namespace gcm { | 13 namespace gcm { |
14 | 14 |
15 class FakeGCMDriver : public GCMDriver { | 15 // TODO(johnme): Maybe this should extend GCMDriver instead? |
| 16 class FakeGCMDriver : public GCMDriverDesktop { |
16 public: | 17 public: |
17 explicit FakeGCMDriver(FakeGCMProfileService* service); | 18 explicit FakeGCMDriver(FakeGCMProfileService* service); |
18 virtual ~FakeGCMDriver(); | 19 virtual ~FakeGCMDriver(); |
19 | 20 |
20 // GCMProfileService overrides. | 21 // GCMProfileService overrides. |
21 virtual void Shutdown() OVERRIDE; | 22 virtual void Shutdown() OVERRIDE; |
22 virtual void AddAppHandler(const std::string& app_id, | 23 virtual void AddAppHandler(const std::string& app_id, |
23 GCMAppHandler* handler) OVERRIDE;; | 24 GCMAppHandler* handler) OVERRIDE;; |
24 virtual void RemoveAppHandler(const std::string& app_id) OVERRIDE;; | 25 virtual void RemoveAppHandler(const std::string& app_id) OVERRIDE;; |
25 virtual void Register(const std::string& app_id, | 26 virtual void Register(const std::string& app_id, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 GCMClient::Result result = GCMClient::SUCCESS; | 141 GCMClient::Result result = GCMClient::SUCCESS; |
141 if (!unregister_responses_.empty()) { | 142 if (!unregister_responses_.empty()) { |
142 result = unregister_responses_.front(); | 143 result = unregister_responses_.front(); |
143 unregister_responses_.pop_front(); | 144 unregister_responses_.pop_front(); |
144 } | 145 } |
145 | 146 |
146 callback.Run(result); | 147 callback.Run(result); |
147 } | 148 } |
148 | 149 |
149 } // namespace gcm | 150 } // namespace gcm |
OLD | NEW |