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

Side by Side Diff: chrome/browser/services/gcm/fake_gcm_profile_service.cc

Issue 278493002: Split GCMDriver into platform-specific implementations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/services/gcm/gcm_profile_service.h » ('j') | chrome/browser/services/gcm/gcm_profile_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698