| OLD | NEW |
| 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 11 matching lines...) Expand all Loading... |
| 22 set_window_ex_style(WS_EX_TOOLWINDOW | WS_EX_LAYERED); | 22 set_window_ex_style(WS_EX_TOOLWINDOW | WS_EX_LAYERED); |
| 23 } | 23 } |
| 24 | 24 |
| 25 AutocompletePopupWin::~AutocompletePopupWin() { | 25 AutocompletePopupWin::~AutocompletePopupWin() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 void AutocompletePopupWin::Show() { | 28 void AutocompletePopupWin::Show() { |
| 29 // Move the popup to the place appropriate for the window's current position - | 29 // Move the popup to the place appropriate for the window's current position - |
| 30 // it may have been moved since it was last shown. | 30 // it may have been moved since it was last shown. |
| 31 SetBounds(contents_->GetPopupBounds()); | 31 SetBounds(contents_->GetPopupBounds()); |
| 32 WidgetWin::Show(); | 32 if (!IsVisible()) |
| 33 WidgetWin::Show(); |
| 33 is_open_ = true; | 34 is_open_ = true; |
| 34 } | 35 } |
| 35 | 36 |
| 36 void AutocompletePopupWin::Hide() { | 37 void AutocompletePopupWin::Hide() { |
| 37 WidgetWin::Hide(); | 38 WidgetWin::Hide(); |
| 38 is_open_ = false; | 39 is_open_ = false; |
| 39 } | 40 } |
| 40 | 41 |
| 41 void AutocompletePopupWin::Init(AutocompleteEditView* edit_view, | 42 void AutocompletePopupWin::Init(AutocompleteEditView* edit_view, |
| 42 views::View* contents) { | 43 views::View* contents) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 68 return !!IsWindow(); | 69 return !!IsWindow(); |
| 69 } | 70 } |
| 70 | 71 |
| 71 //////////////////////////////////////////////////////////////////////////////// | 72 //////////////////////////////////////////////////////////////////////////////// |
| 72 // AutocompletePopupWin, WidgetWin overrides: | 73 // AutocompletePopupWin, WidgetWin overrides: |
| 73 | 74 |
| 74 LRESULT AutocompletePopupWin::OnMouseActivate(HWND window, UINT hit_test, | 75 LRESULT AutocompletePopupWin::OnMouseActivate(HWND window, UINT hit_test, |
| 75 UINT mouse_message) { | 76 UINT mouse_message) { |
| 76 return MA_NOACTIVATE; | 77 return MA_NOACTIVATE; |
| 77 } | 78 } |
| OLD | NEW |