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

Unified Diff: ui/aura/window.cc

Issue 8574033: Beginnings of Window Modality support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/aura/window.cc
===================================================================
--- ui/aura/window.cc (revision 110305)
+++ ui/aura/window.cc (working copy)
@@ -56,17 +56,19 @@
if (transient_parent_)
transient_parent_->RemoveTransientChild(this);
- // Destroy transient children.
- Windows transient_children(transient_children_);
- STLDeleteElements(&transient_children);
- DCHECK(transient_children_.empty());
-
// And let the delegate do any post cleanup.
if (delegate_)
delegate_->OnWindowDestroyed();
if (parent_)
parent_->RemoveChild(this);
+ // Destroy transient children, only after we've removed ourselves from our
+ // parent, as destroying an active transient child may otherwise attempt to
+ // refocus us.
+ Windows transient_children(transient_children_);
+ STLDeleteElements(&transient_children);
+ DCHECK(transient_children_.empty());
+
FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroyed(this));
}
@@ -393,6 +395,10 @@
SetProperty(name, reinterpret_cast<void*>(value));
}
+void Window::SetBoolProperty(const char* name, bool value) {
+ SetProperty(name, reinterpret_cast<void*>(value));
+}
+
void* Window::GetProperty(const char* name) const {
std::map<const char*, void*>::const_iterator iter = prop_map_.find(name);
if (iter == prop_map_.end())
@@ -405,6 +411,10 @@
GetProperty(name)));
}
+bool Window::GetBoolProperty(const char* name) const {
+ return reinterpret_cast<bool>(GetProperty(name));
+}
+
Desktop* Window::GetDesktop() {
return parent_ ? parent_->GetDesktop() : NULL;
}

Powered by Google App Engine
This is Rietveld 408576698