| Index: chrome/browser/views/autocomplete/autocomplete_popup_win.cc
|
| ===================================================================
|
| --- chrome/browser/views/autocomplete/autocomplete_popup_win.cc (revision 31645)
|
| +++ chrome/browser/views/autocomplete/autocomplete_popup_win.cc (working copy)
|
| @@ -14,39 +14,17 @@
|
| // AutocompletePopupWin, public:
|
|
|
| AutocompletePopupWin::AutocompletePopupWin(
|
| - AutocompletePopupContentsView* contents)
|
| - : contents_(contents),
|
| - is_open_(false) {
|
| - set_delete_on_destroy(false);
|
| + AutocompleteEditView* edit_view,
|
| + AutocompletePopupContentsView* contents) {
|
| + // Create the popup.
|
| + set_delete_on_destroy(false); // Owned by |contents|.
|
| set_window_style(WS_POPUP | WS_CLIPCHILDREN);
|
| set_window_ex_style(WS_EX_TOOLWINDOW | WS_EX_LAYERED);
|
| -}
|
| -
|
| -AutocompletePopupWin::~AutocompletePopupWin() {
|
| -}
|
| -
|
| -void AutocompletePopupWin::Show() {
|
| - // Move the popup to the place appropriate for the window's current position -
|
| - // it may have been moved since it was last shown.
|
| - SetBounds(contents_->GetPopupBounds());
|
| - if (!IsVisible())
|
| - WidgetWin::Show();
|
| - is_open_ = true;
|
| -}
|
| -
|
| -void AutocompletePopupWin::Hide() {
|
| - WidgetWin::Hide();
|
| - is_open_ = false;
|
| -}
|
| -
|
| -void AutocompletePopupWin::Init(AutocompleteEditView* edit_view,
|
| - views::View* contents) {
|
| - // Create the popup
|
| WidgetWin::Init(GetAncestor(edit_view->GetNativeView(), GA_ROOT),
|
| - contents_->GetPopupBounds());
|
| + contents->GetPopupBounds());
|
| // The contents is owned by the LocationBarView.
|
| - contents_->set_parent_owned(false);
|
| - SetContentsView(contents_);
|
| + contents->set_parent_owned(false);
|
| + SetContentsView(contents);
|
|
|
| // When an IME is attached to the rich-edit control, retrieve its window
|
| // handle and show this popup window under the IME windows.
|
| @@ -56,19 +34,11 @@
|
| HWND ime_window = ImmGetDefaultIMEWnd(edit_view->GetNativeView());
|
| SetWindowPos(ime_window ? ime_window : HWND_NOTOPMOST, 0, 0, 0, 0,
|
| SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
|
| - is_open_ = true;
|
| }
|
|
|
| -bool AutocompletePopupWin::IsOpen() const {
|
| - const bool is_open = IsCreated() && IsVisible();
|
| - CHECK(is_open == is_open_);
|
| - return is_open;
|
| +AutocompletePopupWin::~AutocompletePopupWin() {
|
| }
|
|
|
| -bool AutocompletePopupWin::IsCreated() const {
|
| - return !!IsWindow();
|
| -}
|
| -
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // AutocompletePopupWin, WidgetWin overrides:
|
|
|
|
|