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

Unified Diff: ui/aura/window_tracker.h

Issue 1484383003: Use WindowTracker when resizing root window as it may delete other window in unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: ui/aura/window_tracker.h
diff --git a/ui/aura/window_tracker.h b/ui/aura/window_tracker.h
index cd839697a0f3c87694746f13e9b8b02ed7691231..d666c2b186978e2490c49702da5cba5778c30afb 100644
--- a/ui/aura/window_tracker.h
+++ b/ui/aura/window_tracker.h
@@ -6,6 +6,7 @@
#define UI_AURA_WINDOW_TRACKER_H_
#include <set>
+#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -15,14 +16,18 @@
namespace aura {
// This class keeps track of a set of windows. A Window is removed either
-// explicitly by Remove(), or implicitly when the window is destroyed.
+// explicitly by Remove() or Pop(), or implicitly when the window is destroyed.
class AURA_EXPORT WindowTracker : public WindowObserver {
public:
typedef std::set<Window*> Windows;
+ using WindowList = std::vector<Window*>;
WindowTracker();
+ explicit WindowTracker(const WindowList& windows);
~WindowTracker() override;
+ bool has_windows() const { return !windows_.empty(); }
+
// Returns the set of windows being observed.
const std::set<Window*>& windows() const { return windows_; }
@@ -36,6 +41,9 @@ class AURA_EXPORT WindowTracker : public WindowObserver {
// deleted.
bool Contains(Window* window);
+ // Removes and returns the window object from the tracking windows.
+ aura::Window* Pop();
+
// WindowObserver overrides:
void OnWindowDestroying(Window* window) override;

Powered by Google App Engine
This is Rietveld 408576698