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

Side by Side Diff: components/view_manager/server_view.cc

Issue 1162943002: Replace more ObserverList with base::ObserverList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@observer
Patch Set: Created 5 years, 6 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/view_manager/server_view.h ('k') | components/wallpaper/wallpaper_manager_base.h » ('j') | 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/view_manager/server_view.h" 5 #include "components/view_manager/server_view.h"
6 6
7 #include <inttypes.h> 7 #include <inttypes.h>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "components/view_manager/server_view_delegate.h" 10 #include "components/view_manager/server_view_delegate.h"
11 #include "components/view_manager/server_view_observer.h" 11 #include "components/view_manager/server_view_observer.h"
12 12
13 namespace view_manager { 13 namespace view_manager {
14 14
15 ServerView::ServerView(ServerViewDelegate* delegate, const ViewId& id) 15 ServerView::ServerView(ServerViewDelegate* delegate, const ViewId& id)
16 : delegate_(delegate), 16 : delegate_(delegate),
17 id_(id), 17 id_(id),
18 parent_(nullptr), 18 parent_(nullptr),
19 visible_(false), 19 visible_(false),
20 opacity_(1), 20 opacity_(1),
21 // Don't notify newly added observers during notification. This causes 21 // Don't notify newly added observers during notification. This causes
22 // problems for code that adds an observer as part of an observer 22 // problems for code that adds an observer as part of an observer
23 // notification (such as ServerViewDrawTracker). 23 // notification (such as ServerViewDrawTracker).
24 observers_(ObserverList<ServerViewObserver>::NOTIFY_EXISTING_ONLY) { 24 observers_(base::ObserverList<ServerViewObserver>::NOTIFY_EXISTING_ONLY) {
25 DCHECK(delegate); // Must provide a delegate. 25 DCHECK(delegate); // Must provide a delegate.
26 } 26 }
27 27
28 ServerView::~ServerView() { 28 ServerView::~ServerView() {
29 delegate_->PrepareToDestroyView(this); 29 delegate_->PrepareToDestroyView(this);
30 FOR_EACH_OBSERVER(ServerViewObserver, observers_, OnWillDestroyView(this)); 30 FOR_EACH_OBSERVER(ServerViewObserver, observers_, OnWillDestroyView(this));
31 31
32 while (!children_.empty()) 32 while (!children_.empty())
33 children_.front()->parent()->Remove(children_.front()); 33 children_.front()->parent()->Remove(children_.front());
34 34
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 child->BuildDebugInfo(depth + " ", result); 225 child->BuildDebugInfo(depth + " ", result);
226 } 226 }
227 #endif 227 #endif
228 228
229 void ServerView::RemoveImpl(ServerView* view) { 229 void ServerView::RemoveImpl(ServerView* view) {
230 view->parent_ = NULL; 230 view->parent_ = NULL;
231 children_.erase(std::find(children_.begin(), children_.end(), view)); 231 children_.erase(std::find(children_.begin(), children_.end(), view));
232 } 232 }
233 233
234 } // namespace view_manager 234 } // namespace view_manager
OLDNEW
« no previous file with comments | « components/view_manager/server_view.h ('k') | components/wallpaper/wallpaper_manager_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698