Commit 69ba6253 authored by sadrul@chromium.org's avatar sadrul@chromium.org

views omnibox popup: Setup the parent Widget, instead of the parent NativeView.

In views-desktop world, the omnibox popup should be parented to the widget the
location-bar belongs to. This fixes pointer events on the popup in touchui.

BUG=none
TEST=manually

Review URL: http://codereview.chromium.org/7584024

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95838 0039d316-1c4b-4281-b951-d872f2087c98
parent 9a14ae61
...@@ -230,7 +230,7 @@ AutocompletePopupContentsView::AutocompletePopupContentsView( ...@@ -230,7 +230,7 @@ AutocompletePopupContentsView::AutocompletePopupContentsView(
OmniboxView* omnibox_view, OmniboxView* omnibox_view,
AutocompleteEditModel* edit_model, AutocompleteEditModel* edit_model,
Profile* profile, Profile* profile,
const views::View* location_bar) views::View* location_bar)
: model_(new AutocompletePopupModel(this, edit_model, profile)), : model_(new AutocompletePopupModel(this, edit_model, profile)),
opt_in_view_(NULL), opt_in_view_(NULL),
omnibox_view_(omnibox_view), omnibox_view_(omnibox_view),
...@@ -357,7 +357,7 @@ void AutocompletePopupContentsView::UpdatePopupAppearance() { ...@@ -357,7 +357,7 @@ void AutocompletePopupContentsView::UpdatePopupAppearance() {
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
params.can_activate = false; params.can_activate = false;
params.transparent = true; params.transparent = true;
params.parent = location_bar_->GetWidget()->GetNativeView(); params.parent_widget = location_bar_->GetWidget();
params.bounds = GetPopupBounds(); params.bounds = GetPopupBounds();
popup_->Init(params); popup_->Init(params);
popup_->SetContentsView(this); popup_->SetContentsView(this);
......
...@@ -37,7 +37,7 @@ class AutocompletePopupContentsView : public views::View, ...@@ -37,7 +37,7 @@ class AutocompletePopupContentsView : public views::View,
OmniboxView* omnibox_view, OmniboxView* omnibox_view,
AutocompleteEditModel* edit_model, AutocompleteEditModel* edit_model,
Profile* profile, Profile* profile,
const views::View* location_bar); views::View* location_bar);
virtual ~AutocompletePopupContentsView(); virtual ~AutocompletePopupContentsView();
// Returns the bounds the popup should be shown at. This is the display bounds // Returns the bounds the popup should be shown at. This is the display bounds
...@@ -144,7 +144,7 @@ class AutocompletePopupContentsView : public views::View, ...@@ -144,7 +144,7 @@ class AutocompletePopupContentsView : public views::View,
OmniboxView* omnibox_view_; OmniboxView* omnibox_view_;
// An object that the popup positions itself against. // An object that the popup positions itself against.
const views::View* location_bar_; views::View* location_bar_;
// Our border, which can compute our desired bounds. // Our border, which can compute our desired bounds.
const BubbleBorder* bubble_border_; const BubbleBorder* bubble_border_;
......
...@@ -58,7 +58,7 @@ TouchAutocompletePopupContentsView::TouchAutocompletePopupContentsView( ...@@ -58,7 +58,7 @@ TouchAutocompletePopupContentsView::TouchAutocompletePopupContentsView(
OmniboxView* omnibox_view, OmniboxView* omnibox_view,
AutocompleteEditModel* edit_model, AutocompleteEditModel* edit_model,
Profile* profile, Profile* profile,
const views::View* location_bar) views::View* location_bar)
: AutocompletePopupContentsView(font, omnibox_view, edit_model, profile, : AutocompletePopupContentsView(font, omnibox_view, edit_model, profile,
location_bar) { location_bar) {
} }
......
...@@ -48,7 +48,7 @@ class TouchAutocompletePopupContentsView ...@@ -48,7 +48,7 @@ class TouchAutocompletePopupContentsView
OmniboxView* omnibox_view, OmniboxView* omnibox_view,
AutocompleteEditModel* edit_model, AutocompleteEditModel* edit_model,
Profile* profile, Profile* profile,
const views::View* location_bar); views::View* location_bar);
virtual ~TouchAutocompletePopupContentsView(); virtual ~TouchAutocompletePopupContentsView();
// AutocompletePopupContentsView: // AutocompletePopupContentsView:
......
...@@ -140,7 +140,7 @@ OmniboxViewViews::OmniboxViewViews(AutocompleteEditController* controller, ...@@ -140,7 +140,7 @@ OmniboxViewViews::OmniboxViewViews(AutocompleteEditController* controller,
Profile* profile, Profile* profile,
CommandUpdater* command_updater, CommandUpdater* command_updater,
bool popup_window_mode, bool popup_window_mode,
const views::View* location_bar) views::View* location_bar)
: model_(new AutocompleteEditModel(this, controller, profile)), : model_(new AutocompleteEditModel(this, controller, profile)),
popup_view_(CreatePopupView(profile, location_bar)), popup_view_(CreatePopupView(profile, location_bar)),
controller_(controller), controller_(controller),
...@@ -690,7 +690,7 @@ void OmniboxViewViews::SelectRange(size_t caret, size_t end) { ...@@ -690,7 +690,7 @@ void OmniboxViewViews::SelectRange(size_t caret, size_t end) {
AutocompletePopupView* OmniboxViewViews::CreatePopupView( AutocompletePopupView* OmniboxViewViews::CreatePopupView(
Profile* profile, Profile* profile,
const View* location_bar) { View* location_bar) {
#if defined(TOUCH_UI) #if defined(TOUCH_UI)
typedef TouchAutocompletePopupContentsView AutocompleteContentsView; typedef TouchAutocompletePopupContentsView AutocompleteContentsView;
#else #else
......
...@@ -47,7 +47,7 @@ class OmniboxViewViews : public views::View, ...@@ -47,7 +47,7 @@ class OmniboxViewViews : public views::View,
Profile* profile, Profile* profile,
CommandUpdater* command_updater, CommandUpdater* command_updater,
bool popup_window_mode, bool popup_window_mode,
const views::View* location_bar); views::View* location_bar);
virtual ~OmniboxViewViews(); virtual ~OmniboxViewViews();
// Initialize, create the underlying views, etc; // Initialize, create the underlying views, etc;
...@@ -157,7 +157,7 @@ class OmniboxViewViews : public views::View, ...@@ -157,7 +157,7 @@ class OmniboxViewViews : public views::View,
void SelectRange(size_t caret, size_t end); void SelectRange(size_t caret, size_t end);
AutocompletePopupView* CreatePopupView(Profile* profile, AutocompletePopupView* CreatePopupView(Profile* profile,
const View* location_bar); View* location_bar);
views::Textfield* textfield_; views::Textfield* textfield_;
......
...@@ -398,7 +398,7 @@ OmniboxViewWin::OmniboxViewWin(const gfx::Font& font, ...@@ -398,7 +398,7 @@ OmniboxViewWin::OmniboxViewWin(const gfx::Font& font,
Profile* profile, Profile* profile,
CommandUpdater* command_updater, CommandUpdater* command_updater,
bool popup_window_mode, bool popup_window_mode,
const views::View* location_bar) views::View* location_bar)
: model_(new AutocompleteEditModel(this, controller, profile)), : model_(new AutocompleteEditModel(this, controller, profile)),
popup_view_(new AutocompletePopupContentsView(font, this, model_.get(), popup_view_(new AutocompletePopupContentsView(font, this, model_.get(),
profile, location_bar)), profile, location_bar)),
......
...@@ -69,7 +69,7 @@ class OmniboxViewWin ...@@ -69,7 +69,7 @@ class OmniboxViewWin
Profile* profile, Profile* profile,
CommandUpdater* command_updater, CommandUpdater* command_updater,
bool popup_window_mode, bool popup_window_mode,
const views::View* location_bar); views::View* location_bar);
~OmniboxViewWin(); ~OmniboxViewWin();
views::View* parent_view() const; views::View* parent_view() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment