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

Unified Diff: chrome/browser/ui/views/dropdown_bar_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: chrome/browser/ui/views/dropdown_bar_host_aura.cc
diff --git a/chrome/browser/ui/views/dropdown_bar_host_aura.cc b/chrome/browser/ui/views/dropdown_bar_host_aura.cc
index 2259fb6d645ee465b5c4a7e6e12928c3dd1b1e4d..6dbbd4077ebf0017e5f96f9e91373ad862dcf4fa 100644
--- a/chrome/browser/ui/views/dropdown_bar_host_aura.cc
+++ b/chrome/browser/ui/views/dropdown_bar_host_aura.cc
@@ -5,8 +5,11 @@
#include "chrome/browser/ui/views/dropdown_bar_host.h"
#include "base/logging.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
#include "ui/aura/window.h"
#include "ui/base/events/event.h"
+#include "ui/views/view.h"
+#include "ui/views/view_constants_aura.h"
#include "ui/views/widget/widget.h"
using content::NativeWebKeyboardEvent;
@@ -27,5 +30,23 @@ void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos,
if (!host_->IsVisible())
host_->GetNativeView()->Show();
host_->GetNativeView()->SetBounds(new_pos);
+
+ if (!host_view_.get()) {
+ // Create view to denote the z-order of |host_| relative to child views of
+ // |browser_view_| which have layers and NativeViews attached to a child
+ // NativeViewHost of |browser_view_|.
+ host_view_.reset(new views::View());
+ host_view_->set_owned_by_client();
+ browser_view_->AddChildView(host_view_.get());
sky 2013/05/13 22:54:17 One reason I like binding to an existing view owne
+
+ // Set the mapping between the view and the NativeView. The property does
+ // not need to be cleared because |host_view_| and |host_| are both
+ // destroyed when DropdownBarHost is destroyed.
+ host_->GetNativeView()->SetProperty(views::kHostViewKey, host_view_.get());
+ }
+ browser_view_->ReorderChildView(host_view_.get(), -1);
+
+ // TODO(pkotwicz): Complete implementing denoting the z-order via
+ // aura::client::kHostViewKey and remove once the implementation is done.
host_->StackAtTop();
}

Powered by Google App Engine
This is Rietveld 408576698