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

Side by Side Diff: chrome/browser/views/autocomplete/autocomplete_popup_win.cc

Issue 140023: Reverting 18872. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "chrome/browser/views/autocomplete/autocomplete_popup_win.h" 5 #include "chrome/browser/views/autocomplete/autocomplete_popup_win.h"
6 6
7 #include "app/gfx/insets.h" 7 #include "app/gfx/insets.h"
8 #include "app/win_util.h" 8 #include "app/win_util.h"
9 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" 9 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h"
10 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" 10 #include "chrome/browser/autocomplete/autocomplete_popup_model.h"
(...skipping 10 matching lines...) Expand all
21 set_window_ex_style(WS_EX_TOOLWINDOW | WS_EX_LAYERED); 21 set_window_ex_style(WS_EX_TOOLWINDOW | WS_EX_LAYERED);
22 } 22 }
23 23
24 AutocompletePopupWin::~AutocompletePopupWin() { 24 AutocompletePopupWin::~AutocompletePopupWin() {
25 } 25 }
26 26
27 void AutocompletePopupWin::Init(AutocompleteEditViewWin* edit_view, 27 void AutocompletePopupWin::Init(AutocompleteEditViewWin* edit_view,
28 views::View* contents) { 28 views::View* contents) {
29 // Create the popup 29 // Create the popup
30 WidgetWin::Init(edit_view->parent_view()->GetWidget()->GetNativeView(), 30 WidgetWin::Init(edit_view->parent_view()->GetWidget()->GetNativeView(),
31 contents_->GetPopupBounds()); 31 contents_->GetPopupBounds(), false);
32 // The contents is owned by the AutocompleteEditViewWin.
33 contents_->SetParentOwned(false);
34 // The contents is owned by the LocationBarView. 32 // The contents is owned by the LocationBarView.
35 contents_->SetParentOwned(false); 33 contents_->SetParentOwned(false);
36 SetContentsView(contents_); 34 SetContentsView(contents_);
37 35
38 // When an IME is attached to the rich-edit control, retrieve its window 36 // When an IME is attached to the rich-edit control, retrieve its window
39 // handle and show this popup window under the IME windows. 37 // handle and show this popup window under the IME windows.
40 // Otherwise, show this popup window under top-most windows. 38 // Otherwise, show this popup window under top-most windows.
41 // TODO(hbono): http://b/1111369 if we exclude this popup window from the 39 // TODO(hbono): http://b/1111369 if we exclude this popup window from the
42 // display area of IME windows, this workaround becomes unnecessary. 40 // display area of IME windows, this workaround becomes unnecessary.
43 HWND ime_window = ImmGetDefaultIMEWnd(edit_view->m_hWnd); 41 HWND ime_window = ImmGetDefaultIMEWnd(edit_view->m_hWnd);
44 SetWindowPos(ime_window ? ime_window : HWND_NOTOPMOST, 0, 0, 0, 0, 42 SetWindowPos(ime_window ? ime_window : HWND_NOTOPMOST, 0, 0, 0, 0,
45 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW); 43 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
46 } 44 }
47 45
48 void AutocompletePopupWin::Show() { 46 void AutocompletePopupWin::Show() {
49 // Move the popup to the place appropriate for the window's current position - 47 // Move the popup to the place appropriate for the window's current position -
50 // it may have been moved since it was last shown. 48 // it may have been moved since it was last shown.
51 SetBounds(contents_->GetPopupBounds()); 49 SetBounds(contents_->GetPopupBounds());
52 if (!IsVisible()) 50 if (!IsVisible())
53 WidgetWin::Show(); 51 WidgetWin::Show();
54 } 52 }
55 53
56 //////////////////////////////////////////////////////////////////////////////// 54 ////////////////////////////////////////////////////////////////////////////////
57 // AutocompletePopupWin, WidgetWin overrides: 55 // AutocompletePopupWin, WidgetWin overrides:
58 56
59 LRESULT AutocompletePopupWin::OnMouseActivate(HWND window, UINT hit_test, 57 LRESULT AutocompletePopupWin::OnMouseActivate(HWND window, UINT hit_test,
60 UINT mouse_message) { 58 UINT mouse_message) {
61 return MA_NOACTIVATE; 59 return MA_NOACTIVATE;
62 } 60 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_win.cc ('k') | chrome/browser/views/blocked_popup_container_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698