OLD | NEW |
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 #include "chrome/browser/services/gcm/fake_gcm_client_factory.h" | 5 #include "chrome/browser/services/gcm/fake_gcm_client_factory.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" |
8 #include "google_apis/gcm/gcm_client.h" | 9 #include "google_apis/gcm/gcm_client.h" |
9 | 10 |
10 namespace gcm { | 11 namespace gcm { |
11 | 12 |
12 FakeGCMClientFactory::FakeGCMClientFactory( | 13 FakeGCMClientFactory::FakeGCMClientFactory( |
13 FakeGCMClient::StartMode gcm_client_start_mode) | 14 FakeGCMClient::StartMode gcm_client_start_mode, |
14 : gcm_client_start_mode_(gcm_client_start_mode) { | 15 const scoped_refptr<base::MessageLoopProxy>& ui_thread, |
| 16 const scoped_refptr<base::MessageLoopProxy>& io_thread) |
| 17 : gcm_client_start_mode_(gcm_client_start_mode), |
| 18 ui_thread_(ui_thread), |
| 19 io_thread_(io_thread) { |
15 } | 20 } |
16 | 21 |
17 FakeGCMClientFactory::~FakeGCMClientFactory() { | 22 FakeGCMClientFactory::~FakeGCMClientFactory() { |
18 } | 23 } |
19 | 24 |
20 scoped_ptr<GCMClient> FakeGCMClientFactory::BuildInstance() { | 25 scoped_ptr<GCMClient> FakeGCMClientFactory::BuildInstance() { |
21 return scoped_ptr<GCMClient>(new FakeGCMClient(gcm_client_start_mode_)); | 26 return scoped_ptr<GCMClient>(new FakeGCMClient( |
| 27 gcm_client_start_mode_, ui_thread_, io_thread_)); |
22 } | 28 } |
23 | 29 |
24 } // namespace gcm | 30 } // namespace gcm |
OLD | NEW |