Chromium Code Reviews| 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..b37679de07873ef92eab4c789371c2ae254d7891 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/client/aura_constants.h" |
| #include "ui/aura/window.h" |
| #include "ui/base/events/event.h" |
| +#include "ui/views/view.h" |
| #include "ui/views/widget/widget.h" |
| using content::NativeWebKeyboardEvent; |
| @@ -27,5 +30,24 @@ void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos, |
| if (!host_->IsVisible()) |
| host_->GetNativeView()->Show(); |
| host_->GetNativeView()->SetBounds(new_pos); |
| + |
| + if (!host_view_.get()) { |
|
sky
2013/05/13 15:53:14
Could we instead always create a View for this in
pkotwicz
2013/05/13 20:20:44
I think that creating the view here makes more sen
|
| + // 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()); |
| + |
| + // 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(aura::client::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(); |
| } |