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

Side by Side Diff: ui/arc/notification/arc_notification_surface_manager.cc

Issue 2416633002: Remove FOR_EACH_OBSERVER from arc/ since it's being deprecated (Closed)
Patch Set: remove braces 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/arc/notification/arc_notification_surface_manager.h" 5 #include "ui/arc/notification/arc_notification_surface_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "components/exo/notification_surface.h" 9 #include "components/exo/notification_surface.h"
10 10
(...skipping 29 matching lines...) Expand all
40 void ArcNotificationSurfaceManager::AddSurface( 40 void ArcNotificationSurfaceManager::AddSurface(
41 exo::NotificationSurface* surface) { 41 exo::NotificationSurface* surface) {
42 if (notification_surface_map_.find(surface->notification_id()) != 42 if (notification_surface_map_.find(surface->notification_id()) !=
43 notification_surface_map_.end()) { 43 notification_surface_map_.end()) {
44 NOTREACHED(); 44 NOTREACHED();
45 return; 45 return;
46 } 46 }
47 47
48 notification_surface_map_[surface->notification_id()] = surface; 48 notification_surface_map_[surface->notification_id()] = surface;
49 49
50 FOR_EACH_OBSERVER(Observer, observers_, OnNotificationSurfaceAdded(surface)); 50 for (auto& observer : observers_)
51 observer.OnNotificationSurfaceAdded(surface);
51 } 52 }
52 53
53 void ArcNotificationSurfaceManager::RemoveSurface( 54 void ArcNotificationSurfaceManager::RemoveSurface(
54 exo::NotificationSurface* surface) { 55 exo::NotificationSurface* surface) {
55 auto it = notification_surface_map_.find(surface->notification_id()); 56 auto it = notification_surface_map_.find(surface->notification_id());
56 if (it == notification_surface_map_.end()) 57 if (it == notification_surface_map_.end())
57 return; 58 return;
58 59
59 notification_surface_map_.erase(it); 60 notification_surface_map_.erase(it);
60 FOR_EACH_OBSERVER(Observer, observers_, 61 for (auto& observer : observers_)
61 OnNotificationSurfaceRemoved(surface)); 62 observer.OnNotificationSurfaceRemoved(surface);
62 } 63 }
63 64
64 void ArcNotificationSurfaceManager::AddObserver(Observer* observer) { 65 void ArcNotificationSurfaceManager::AddObserver(Observer* observer) {
65 observers_.AddObserver(observer); 66 observers_.AddObserver(observer);
66 } 67 }
67 68
68 void ArcNotificationSurfaceManager::RemoveObserver(Observer* observer) { 69 void ArcNotificationSurfaceManager::RemoveObserver(Observer* observer) {
69 observers_.RemoveObserver(observer); 70 observers_.RemoveObserver(observer);
70 } 71 }
71 72
72 } // namespace arc 73 } // namespace arc
OLDNEW
« components/arc/arc_bridge_service.cc ('K') | « ui/arc/notification/arc_custom_notification_item.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698