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

Side by Side Diff: components/zoom/zoom_event_manager.cc

Issue 2430823002: 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
« no previous file with comments | « components/zoom/zoom_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/zoom/zoom_event_manager.h" 5 #include "components/zoom/zoom_event_manager.h"
6 6
7 #include "components/zoom/zoom_event_manager_observer.h" 7 #include "components/zoom/zoom_event_manager_observer.h"
8 #include "content/public/browser/browser_context.h" 8 #include "content/public/browser/browser_context.h"
9 9
10 namespace { 10 namespace {
(...skipping 19 matching lines...) Expand all
30 zoom_level_changed_callbacks_.Notify(change); 30 zoom_level_changed_callbacks_.Notify(change);
31 } 31 }
32 32
33 std::unique_ptr<content::HostZoomMap::Subscription> 33 std::unique_ptr<content::HostZoomMap::Subscription>
34 ZoomEventManager::AddZoomLevelChangedCallback( 34 ZoomEventManager::AddZoomLevelChangedCallback(
35 const content::HostZoomMap::ZoomLevelChangedCallback& callback) { 35 const content::HostZoomMap::ZoomLevelChangedCallback& callback) {
36 return zoom_level_changed_callbacks_.Add(callback); 36 return zoom_level_changed_callbacks_.Add(callback);
37 } 37 }
38 38
39 void ZoomEventManager::OnDefaultZoomLevelChanged() { 39 void ZoomEventManager::OnDefaultZoomLevelChanged() {
40 FOR_EACH_OBSERVER(ZoomEventManagerObserver, observers_, 40 for (auto& observer : observers_)
41 OnDefaultZoomLevelChanged()); 41 observer.OnDefaultZoomLevelChanged();
42 } 42 }
43 43
44 void ZoomEventManager::AddZoomEventManagerObserver( 44 void ZoomEventManager::AddZoomEventManagerObserver(
45 ZoomEventManagerObserver* observer) { 45 ZoomEventManagerObserver* observer) {
46 observers_.AddObserver(observer); 46 observers_.AddObserver(observer);
47 } 47 }
48 48
49 void ZoomEventManager::RemoveZoomEventManagerObserver( 49 void ZoomEventManager::RemoveZoomEventManagerObserver(
50 ZoomEventManagerObserver* observer) { 50 ZoomEventManagerObserver* observer) {
51 observers_.RemoveObserver(observer); 51 observers_.RemoveObserver(observer);
52 } 52 }
53 53
54 } // namespace zoom 54 } // namespace zoom
OLDNEW
« no previous file with comments | « components/zoom/zoom_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698