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

Unified Diff: ui/base/window_tracker_template.h

Issue 2455963006: Wires up drag/drop for aura-mus (Closed)
Patch Set: twweaks 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/mus/window_tree_client.cc ('k') | ui/views/mus/drop_target_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/window_tracker_template.h
diff --git a/ui/base/window_tracker_template.h b/ui/base/window_tracker_template.h
index 5bcaccb40bd4f325cd5814bfaa69fc0b2fc11c73..e91bdac8077b29cd53cc9aca13dbf753b25e3201 100644
--- a/ui/base/window_tracker_template.h
+++ b/ui/base/window_tracker_template.h
@@ -30,10 +30,7 @@ class WindowTrackerTemplate : public TObserver {
Add(window);
}
WindowTrackerTemplate() {}
- ~WindowTrackerTemplate() override {
- for (T* window : windows_)
- window->RemoveObserver(this);
- }
+ ~WindowTrackerTemplate() override { RemoveAll(); }
// Returns the set of windows being observed.
const WindowList& windows() const { return windows_; }
@@ -47,6 +44,12 @@ class WindowTrackerTemplate : public TObserver {
windows_.push_back(window);
}
+ void RemoveAll() {
+ for (T* window : windows_)
+ window->RemoveObserver(this);
+ windows_.clear();
+ }
+
// Removes |window| from the set of windows being tracked.
void Remove(T* window) {
auto iter = std::find(windows_.begin(), windows_.end(), window);
« no previous file with comments | « ui/aura/mus/window_tree_client.cc ('k') | ui/views/mus/drop_target_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698