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

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

Issue 2423353002: Reduce usage of FOR_EACH_OBSERVER macro in components/ (Closed)
Patch Set: Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 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 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 "components/proximity_auth/cryptauth/fake_cryptauth_gcm_manager.h" 5 #include "components/proximity_auth/cryptauth/fake_cryptauth_gcm_manager.h"
6 6
7 namespace proximity_auth { 7 namespace proximity_auth {
8 8
9 FakeCryptAuthGCMManager::FakeCryptAuthGCMManager( 9 FakeCryptAuthGCMManager::FakeCryptAuthGCMManager(
10 const std::string& registration_id) 10 const std::string& registration_id)
(...skipping 18 matching lines...) Expand all
29 void FakeCryptAuthGCMManager::RemoveObserver(Observer* observer) { 29 void FakeCryptAuthGCMManager::RemoveObserver(Observer* observer) {
30 observers_.RemoveObserver(observer); 30 observers_.RemoveObserver(observer);
31 } 31 }
32 32
33 void FakeCryptAuthGCMManager::CompleteRegistration( 33 void FakeCryptAuthGCMManager::CompleteRegistration(
34 const std::string& registration_id) { 34 const std::string& registration_id) {
35 DCHECK(registration_in_progress_); 35 DCHECK(registration_in_progress_);
36 registration_in_progress_ = false; 36 registration_in_progress_ = false;
37 registration_id_ = registration_id; 37 registration_id_ = registration_id;
38 bool success = !registration_id_.empty(); 38 bool success = !registration_id_.empty();
39 FOR_EACH_OBSERVER(Observer, observers_, OnGCMRegistrationResult(success)); 39 for (auto& observer : observers_)
40 observer.OnGCMRegistrationResult(success);
40 } 41 }
41 42
42 void FakeCryptAuthGCMManager::PushReenrollMessage() { 43 void FakeCryptAuthGCMManager::PushReenrollMessage() {
43 FOR_EACH_OBSERVER(Observer, observers_, OnReenrollMessage()); 44 for (auto& observer : observers_)
45 observer.OnReenrollMessage();
44 } 46 }
45 47
46 void FakeCryptAuthGCMManager::PushResyncMessage() { 48 void FakeCryptAuthGCMManager::PushResyncMessage() {
47 FOR_EACH_OBSERVER(Observer, observers_, OnResyncMessage()); 49 for (auto& observer : observers_)
50 observer.OnResyncMessage();
48 } 51 }
49 52
50 } // namespace proximity_auth 53 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698