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

Side by Side Diff: components/proximity_auth/cryptauth/fake_cryptauth_gcm_manager.cc

Issue 2502343003: Moved //components/proximity_auth/cryptauth to //components/cryptauth. (Closed)
Patch Set: Prefixed two test names with "CryptAuth" so that they do not collide with other test names. Created 4 years, 1 month 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/proximity_auth/cryptauth/fake_cryptauth_gcm_manager.h"
6
7 namespace proximity_auth {
8
9 FakeCryptAuthGCMManager::FakeCryptAuthGCMManager(
10 const std::string& registration_id)
11 : registration_in_progress_(false), registration_id_(registration_id) {}
12
13 FakeCryptAuthGCMManager::~FakeCryptAuthGCMManager() {}
14
15 void FakeCryptAuthGCMManager::StartListening() {}
16
17 void FakeCryptAuthGCMManager::RegisterWithGCM() {
18 registration_in_progress_ = true;
19 }
20
21 std::string FakeCryptAuthGCMManager::GetRegistrationId() {
22 return registration_id_;
23 }
24
25 void FakeCryptAuthGCMManager::AddObserver(Observer* observer) {
26 observers_.AddObserver(observer);
27 }
28
29 void FakeCryptAuthGCMManager::RemoveObserver(Observer* observer) {
30 observers_.RemoveObserver(observer);
31 }
32
33 void FakeCryptAuthGCMManager::CompleteRegistration(
34 const std::string& registration_id) {
35 DCHECK(registration_in_progress_);
36 registration_in_progress_ = false;
37 registration_id_ = registration_id;
38 bool success = !registration_id_.empty();
39 for (auto& observer : observers_)
40 observer.OnGCMRegistrationResult(success);
41 }
42
43 void FakeCryptAuthGCMManager::PushReenrollMessage() {
44 for (auto& observer : observers_)
45 observer.OnReenrollMessage();
46 }
47
48 void FakeCryptAuthGCMManager::PushResyncMessage() {
49 for (auto& observer : observers_)
50 observer.OnResyncMessage();
51 }
52
53 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698