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

Unified Diff: ui/views/controls/native/native_view_host_aura.cc

Issue 15114002: Reorder the NativeViews attached to a view via kViewHostKey according to the position of the view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
Index: ui/views/controls/native/native_view_host_aura.cc
diff --git a/ui/views/controls/native/native_view_host_aura.cc b/ui/views/controls/native/native_view_host_aura.cc
index fb8a725bc59389d076186c0a9766974444447694..3a3ed14f80cd1263919e3c25c60fcad62d00a067 100644
--- a/ui/views/controls/native/native_view_host_aura.cc
+++ b/ui/views/controls/native/native_view_host_aura.cc
@@ -8,6 +8,7 @@
#include "ui/aura/focus_manager.h"
#include "ui/aura/window.h"
#include "ui/views/controls/native/native_view_host.h"
+#include "ui/views/view_constants_aura.h"
#include "ui/views/widget/widget.h"
namespace views {
@@ -18,18 +19,23 @@ NativeViewHostAura::NativeViewHostAura(NativeViewHost* host)
}
NativeViewHostAura::~NativeViewHostAura() {
- if (host_->native_view())
+ if (host_->native_view()) {
+ host_->native_view()->ClearProperty(views::kHostViewKey);
host_->native_view()->RemoveObserver(this);
+ }
}
////////////////////////////////////////////////////////////////////////////////
// NativeViewHostAura, NativeViewHostWrapper implementation:
void NativeViewHostAura::NativeViewWillAttach() {
host_->native_view()->AddObserver(this);
+ host_->native_view()->SetProperty(views::kHostViewKey,
+ static_cast<View*>(host_));
}
void NativeViewHostAura::NativeViewDetaching(bool destroyed) {
if (!destroyed) {
+ host_->native_view()->ClearProperty(views::kHostViewKey);
host_->native_view()->RemoveObserver(this);
host_->native_view()->Hide();
if (host_->native_view()->parent())

Powered by Google App Engine
This is Rietveld 408576698