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

Side by Side Diff: mojo/services/public/cpp/view_manager/view_tracker.h

Issue 728133002: Update mojo sdk to rev e01f9a49449381a5eb430c1fd88bf2cae73ec35a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android + ios gyp fixes Created 6 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 2014 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 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TRACKER_H_
6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TRACKER_H_
7
8 #include <set>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "mojo/services/public/cpp/view_manager/view_observer.h"
13
14 namespace mojo {
15
16 class ViewTracker : public ViewObserver {
17 public:
18 using Views = std::set<View*>;
19
20 ViewTracker();
21 ~ViewTracker() override;
22
23 // Returns the set of views being observed.
24 const std::set<View*>& views() const { return views_; }
25
26 // Adds |view| to the set of Views being tracked.
27 void Add(View* view);
28
29 // Removes |view| from the set of views being tracked.
30 void Remove(View* view);
31
32 // Returns true if |view| was previously added and has not been removed or
33 // deleted.
34 bool Contains(View* view);
35
36 // ViewObserver overrides:
37 virtual void OnViewDestroying(View* view) override;
38
39 private:
40 Views views_;
41
42 DISALLOW_COPY_AND_ASSIGN(ViewTracker);
43 };
44
45 } // namespace mojo
46
47 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_TRACKER_H_
OLDNEW
« no previous file with comments | « mojo/services/public/cpp/view_manager/tests/BUILD.gn ('k') | mojo/services/public/cpp/view_manager/view_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698