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

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

Issue 1231613005: Hook up the Push API with GCM's new ability to own encryption keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-encryption
Patch Set: Created 5 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
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/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 const std::string& receiver_id, 44 const std::string& receiver_id,
45 const OutgoingMessage& message) override; 45 const OutgoingMessage& message) override;
46 46
47 private: 47 private:
48 FakeGCMProfileService* service_; 48 FakeGCMProfileService* service_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(CustomFakeGCMDriver); 50 DISALLOW_COPY_AND_ASSIGN(CustomFakeGCMDriver);
51 }; 51 };
52 52
53 CustomFakeGCMDriver::CustomFakeGCMDriver(FakeGCMProfileService* service) 53 CustomFakeGCMDriver::CustomFakeGCMDriver(FakeGCMProfileService* service)
54 : service_(service) { 54 : FakeGCMDriver(base::ThreadTaskRunnerHandle::Get()),
55 service_(service) {
55 } 56 }
56 57
57 CustomFakeGCMDriver::~CustomFakeGCMDriver() { 58 CustomFakeGCMDriver::~CustomFakeGCMDriver() {
58 } 59 }
59 60
60 void CustomFakeGCMDriver::RegisterImpl( 61 void CustomFakeGCMDriver::RegisterImpl(
61 const std::string& app_id, 62 const std::string& app_id,
62 const std::vector<std::string>& sender_ids) { 63 const std::vector<std::string>& sender_ids) {
63 base::ThreadTaskRunnerHandle::Get()->PostTask( 64 base::ThreadTaskRunnerHandle::Get()->PostTask(
64 FROM_HERE, base::Bind(&FakeGCMProfileService::RegisterFinished, 65 FROM_HERE, base::Bind(&FakeGCMProfileService::RegisterFinished,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 GCMClient::Result result) { 169 GCMClient::Result result) {
169 unregister_responses_.push_back(result); 170 unregister_responses_.push_back(result);
170 } 171 }
171 172
172 void FakeGCMProfileService::SetUnregisterCallback( 173 void FakeGCMProfileService::SetUnregisterCallback(
173 const UnregisterCallback& callback) { 174 const UnregisterCallback& callback) {
174 unregister_callback_ = callback; 175 unregister_callback_ = callback;
175 } 176 }
176 177
177 } // namespace gcm 178 } // namespace gcm
OLDNEW
« no previous file with comments | « chrome/browser/push_messaging/push_messaging_service_impl.cc ('k') | chrome/browser/services/gcm/gcm_profile_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698