OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <locale> | 8 #include <locale> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 #include "ui/base/clipboard/clipboard.h" | 41 #include "ui/base/clipboard/clipboard.h" |
42 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 42 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
43 #include "ui/base/dragdrop/drag_drop_types.h" | 43 #include "ui/base/dragdrop/drag_drop_types.h" |
44 #include "ui/base/dragdrop/drag_source.h" | 44 #include "ui/base/dragdrop/drag_source.h" |
45 #include "ui/base/dragdrop/drop_target.h" | 45 #include "ui/base/dragdrop/drop_target.h" |
46 #include "ui/base/dragdrop/os_exchange_data.h" | 46 #include "ui/base/dragdrop/os_exchange_data.h" |
47 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" | 47 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
48 #include "ui/base/keycodes/keyboard_codes.h" | 48 #include "ui/base/keycodes/keyboard_codes.h" |
49 #include "ui/base/l10n/l10n_util.h" | 49 #include "ui/base/l10n/l10n_util.h" |
50 #include "ui/base/l10n/l10n_util_win.h" | 50 #include "ui/base/l10n/l10n_util_win.h" |
| 51 #include "ui/base/win/mouse_wheel_util.h" |
51 #include "ui/gfx/canvas.h" | 52 #include "ui/gfx/canvas.h" |
52 #include "ui/gfx/canvas_skia.h" | 53 #include "ui/gfx/canvas_skia.h" |
53 #include "views/controls/textfield/native_textfield_win.h" | 54 #include "views/controls/textfield/native_textfield_win.h" |
54 #include "views/drag_utils.h" | 55 #include "views/drag_utils.h" |
55 #include "views/events/event_utils_win.h" | 56 #include "views/events/event_utils_win.h" |
56 #include "views/focus/focus_util_win.h" | |
57 #include "views/widget/widget.h" | 57 #include "views/widget/widget.h" |
58 | 58 |
59 #pragma comment(lib, "oleacc.lib") // Needed for accessibility support. | 59 #pragma comment(lib, "oleacc.lib") // Needed for accessibility support. |
60 #pragma comment(lib, "riched20.lib") // Needed for the richedit control. | 60 #pragma comment(lib, "riched20.lib") // Needed for the richedit control. |
61 | 61 |
62 /////////////////////////////////////////////////////////////////////////////// | 62 /////////////////////////////////////////////////////////////////////////////// |
63 // AutocompleteEditModel | 63 // AutocompleteEditModel |
64 | 64 |
65 namespace { | 65 namespace { |
66 | 66 |
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 } | 1806 } |
1807 | 1807 |
1808 void OmniboxViewWin::OnWindowPosChanging(WINDOWPOS* window_pos) { | 1808 void OmniboxViewWin::OnWindowPosChanging(WINDOWPOS* window_pos) { |
1809 if (force_hidden_) | 1809 if (force_hidden_) |
1810 window_pos->flags &= ~SWP_SHOWWINDOW; | 1810 window_pos->flags &= ~SWP_SHOWWINDOW; |
1811 SetMsgHandled(true); | 1811 SetMsgHandled(true); |
1812 } | 1812 } |
1813 | 1813 |
1814 BOOL OmniboxViewWin::OnMouseWheel(UINT flags, short delta, CPoint point) { | 1814 BOOL OmniboxViewWin::OnMouseWheel(UINT flags, short delta, CPoint point) { |
1815 // Forward the mouse-wheel message to the window under the mouse. | 1815 // Forward the mouse-wheel message to the window under the mouse. |
1816 if (!views::RerouteMouseWheel(m_hWnd, MAKEWPARAM(flags, delta), | 1816 if (!ui::RerouteMouseWheel(m_hWnd, MAKEWPARAM(flags, delta), |
1817 MAKELPARAM(point.x, point.y))) | 1817 MAKELPARAM(point.x, point.y))) |
1818 SetMsgHandled(false); | 1818 SetMsgHandled(false); |
1819 return 0; | 1819 return 0; |
1820 } | 1820 } |
1821 | 1821 |
1822 void OmniboxViewWin::HandleKeystroke(UINT message, | 1822 void OmniboxViewWin::HandleKeystroke(UINT message, |
1823 TCHAR key, | 1823 TCHAR key, |
1824 UINT repeat_count, | 1824 UINT repeat_count, |
1825 UINT flags) { | 1825 UINT flags) { |
1826 ScopedFreeze freeze(this, GetTextObjectModel()); | 1826 ScopedFreeze freeze(this, GetTextObjectModel()); |
1827 OnBeforePossibleChange(); | 1827 OnBeforePossibleChange(); |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 // PosFromChar(i) might return 0 when i is greater than 1. | 2599 // PosFromChar(i) might return 0 when i is greater than 1. |
2600 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2600 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
2601 } | 2601 } |
2602 | 2602 |
2603 bool OmniboxViewWin::IsCaretAtEnd() const { | 2603 bool OmniboxViewWin::IsCaretAtEnd() const { |
2604 long length = GetTextLength(); | 2604 long length = GetTextLength(); |
2605 CHARRANGE sel; | 2605 CHARRANGE sel; |
2606 GetSelection(sel); | 2606 GetSelection(sel); |
2607 return sel.cpMin == sel.cpMax && sel.cpMin == length; | 2607 return sel.cpMin == sel.cpMax && sel.cpMin == length; |
2608 } | 2608 } |
OLD | NEW |