summaryrefslogtreecommitdiffstats
path: root/components/mus/public/cpp/window_tracker.h
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2015-10-15 17:12:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-16 00:13:20 +0000
commit68afcf453d29c8f311b34a0aa210e042d4adc132 (patch)
tree5d7e25e02abe745aec485ecb4450f37d24b080c8 /components/mus/public/cpp/window_tracker.h
parentda33ab883a2046613836487d852d5fd36f1dc4c3 (diff)
downloadchromium_src-68afcf453d29c8f311b34a0aa210e042d4adc132.zip
chromium_src-68afcf453d29c8f311b34a0aa210e042d4adc132.tar.gz
chromium_src-68afcf453d29c8f311b34a0aa210e042d4adc132.tar.bz2
View => Window in components/mus/public/cpp
This CL updates the client lib to refer to mus::Windows and mus::WindowServer instead of View and View Manager. I hope I caught everything. I'll clean things up in subsequent CLs, and start renaming the interfaces and implementation. BUG=542848 Review URL: https://codereview.chromium.org/1402223003 Cr-Commit-Position: refs/heads/master@{#354411}
Diffstat (limited to 'components/mus/public/cpp/window_tracker.h')
-rw-r--r--components/mus/public/cpp/window_tracker.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/components/mus/public/cpp/window_tracker.h b/components/mus/public/cpp/window_tracker.h
new file mode 100644
index 0000000..f2f4963
--- /dev/null
+++ b/components/mus/public/cpp/window_tracker.h
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TRACKER_H_
+#define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TRACKER_H_
+
+#include <stdint.h>
+#include <set>
+
+#include "components/mus/public/cpp/window_observer.h"
+#include "third_party/mojo/src/mojo/public/cpp/system/macros.h"
+
+namespace mus {
+
+class WindowTracker : public WindowObserver {
+ public:
+ using Windows = std::set<Window*>;
+
+ WindowTracker();
+ ~WindowTracker() override;
+
+ // Returns the set of windows being observed.
+ const std::set<Window*>& windows() const { return windows_; }
+
+ // Adds |window| to the set of Windows being tracked.
+ void Add(Window* window);
+
+ // Removes |window| from the set of windows being tracked.
+ void Remove(Window* window);
+
+ // Returns true if |window| was previously added and has not been removed or
+ // deleted.
+ bool Contains(Window* window);
+
+ // WindowObserver overrides:
+ void OnWindowDestroying(Window* window) override;
+
+ private:
+ Windows windows_;
+
+ MOJO_DISALLOW_COPY_AND_ASSIGN(WindowTracker);
+};
+
+} // namespace mus
+
+#endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TRACKER_H_