Index: chrome/browser/ui/views/dropdown_bar_host.cc |
diff --git a/chrome/browser/ui/views/dropdown_bar_host.cc b/chrome/browser/ui/views/dropdown_bar_host.cc |
index e2c408873f780c1be6d672bb84f0c2fc0ba01f5d..43f7a48ef85e937051f89e248af02b366547bc9d 100644 |
--- a/chrome/browser/ui/views/dropdown_bar_host.cc |
+++ b/chrome/browser/ui/views/dropdown_bar_host.cc |
@@ -17,6 +17,29 @@ |
#include "ui/views/focus/view_storage.h" |
#include "ui/views/widget/widget.h" |
+namespace { |
+ |
+// TODO(estade): move this to its own file and reuse for |
Evan Stade
2016/01/27 00:44:18
I would complete this TODO before landing, but onl
|
+// OmniboxPopupContentsView::popup_. |
+class ThemeCopyingWidget : public views::Widget { |
+ public: |
+ explicit ThemeCopyingWidget(views::Widget* role_model) |
+ : role_model_(role_model) {} |
+ ~ThemeCopyingWidget() override {} |
+ |
+ const ui::NativeTheme* GetNativeTheme() const override { |
+ return role_model_->GetNativeTheme(); |
+ } |
+ |
+ private: |
+ // The widget we'll copy our theme from. |
+ views::Widget* role_model_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ThemeCopyingWidget); |
+}; |
+ |
+} // namespace |
+ |
// static |
bool DropdownBarHost::disable_animations_during_testing_ = false; |
@@ -48,7 +71,7 @@ void DropdownBarHost::Init(views::View* host_view, |
delegate_ = delegate; |
// Initialize the host. |
- host_.reset(new views::Widget); |
+ host_.reset(new ThemeCopyingWidget(browser_view_->GetWidget())); |
views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
params.parent = browser_view_->GetWidget()->GetNativeView(); |