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 // Need Win 7 headers for WM_GESTURE and ChangeWindowMessageFilterEx | 5 // Need Win 7 headers for WM_GESTURE and ChangeWindowMessageFilterEx |
6 // TODO(jschuh): See crbug.com/92941 for longterm fix. | 6 // TODO(jschuh): See crbug.com/92941 for longterm fix. |
7 #undef WINVER | 7 #undef WINVER |
8 #define WINVER _WIN32_WINNT_WIN7 | 8 #define WINVER _WIN32_WINNT_WIN7 |
9 #undef _WIN32_WINNT | 9 #undef _WIN32_WINNT |
10 #define _WIN32_WINNT _WIN32_WINNT_WIN7 | 10 #define _WIN32_WINNT _WIN32_WINNT_WIN7 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "content/common/view_messages.h" | 42 #include "content/common/view_messages.h" |
43 #include "grit/webkit_resources.h" | 43 #include "grit/webkit_resources.h" |
44 #include "skia/ext/skia_utils_win.h" | 44 #include "skia/ext/skia_utils_win.h" |
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
47 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact
ory.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact
ory.h" |
48 #include "ui/base/ime/composition_text.h" | 48 #include "ui/base/ime/composition_text.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/resource/resource_bundle.h" | 51 #include "ui/base/resource/resource_bundle.h" |
| 52 #include "ui/base/text/text_elider.h" |
52 #include "ui/base/view_prop.h" | 53 #include "ui/base/view_prop.h" |
53 #include "ui/base/win/hwnd_util.h" | 54 #include "ui/base/win/hwnd_util.h" |
54 #include "ui/gfx/canvas.h" | 55 #include "ui/gfx/canvas.h" |
55 #include "ui/gfx/canvas_skia.h" | 56 #include "ui/gfx/canvas_skia.h" |
56 #include "ui/gfx/gdi_util.h" | 57 #include "ui/gfx/gdi_util.h" |
57 #include "ui/gfx/rect.h" | 58 #include "ui/gfx/rect.h" |
58 #include "ui/gfx/screen.h" | 59 #include "ui/gfx/screen.h" |
59 #include "views/accessibility/native_view_accessibility_win.h" | 60 #include "views/accessibility/native_view_accessibility_win.h" |
60 #include "views/focus/focus_manager.h" | 61 #include "views/focus/focus_manager.h" |
61 #include "views/focus/focus_util_win.h" | 62 #include "views/focus/focus_util_win.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 being_destroyed_ = true; | 745 being_destroyed_ = true; |
745 CleanupCompositorWindow(); | 746 CleanupCompositorWindow(); |
746 DestroyWindow(); | 747 DestroyWindow(); |
747 } | 748 } |
748 | 749 |
749 void RenderWidgetHostViewWin::SetTooltipText(const std::wstring& tooltip_text) { | 750 void RenderWidgetHostViewWin::SetTooltipText(const std::wstring& tooltip_text) { |
750 // Clamp the tooltip length to kMaxTooltipLength so that we don't | 751 // Clamp the tooltip length to kMaxTooltipLength so that we don't |
751 // accidentally DOS the user with a mega tooltip (since Windows doesn't seem | 752 // accidentally DOS the user with a mega tooltip (since Windows doesn't seem |
752 // to do this itself). | 753 // to do this itself). |
753 const std::wstring& new_tooltip_text = | 754 const std::wstring& new_tooltip_text = |
754 l10n_util::TruncateString(tooltip_text, kMaxTooltipLength); | 755 ui::TruncateString(tooltip_text, kMaxTooltipLength); |
755 | 756 |
756 if (new_tooltip_text != tooltip_text_) { | 757 if (new_tooltip_text != tooltip_text_) { |
757 tooltip_text_ = new_tooltip_text; | 758 tooltip_text_ = new_tooltip_text; |
758 | 759 |
759 // Need to check if the tooltip is already showing so that we don't | 760 // Need to check if the tooltip is already showing so that we don't |
760 // immediately show the tooltip with no delay when we move the mouse from | 761 // immediately show the tooltip with no delay when we move the mouse from |
761 // a region with no tooltip to a region with a tooltip. | 762 // a region with no tooltip to a region with a tooltip. |
762 if (::IsWindow(tooltip_hwnd_) && tooltip_showing_) { | 763 if (::IsWindow(tooltip_hwnd_) && tooltip_showing_) { |
763 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); | 764 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); |
764 ::SendMessage(tooltip_hwnd_, TTM_POPUP, 0, 0); | 765 ::SendMessage(tooltip_hwnd_, TTM_POPUP, 0, 0); |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 DWORD ex_style) { | 1879 DWORD ex_style) { |
1879 parent_hwnd_ = parent_hwnd; | 1880 parent_hwnd_ = parent_hwnd; |
1880 Create(parent_hwnd_, NULL, NULL, WS_POPUP, ex_style); | 1881 Create(parent_hwnd_, NULL, NULL, WS_POPUP, ex_style); |
1881 MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE); | 1882 MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE); |
1882 // To show tooltip on popup window.(e.g. title in <select>) | 1883 // To show tooltip on popup window.(e.g. title in <select>) |
1883 // Popups default to showing, which means |DidBecomeSelected()| isn't invoked. | 1884 // Popups default to showing, which means |DidBecomeSelected()| isn't invoked. |
1884 // Ensure the tooltip is created otherwise tooltips are never shown. | 1885 // Ensure the tooltip is created otherwise tooltips are never shown. |
1885 EnsureTooltip(); | 1886 EnsureTooltip(); |
1886 ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA); | 1887 ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA); |
1887 } | 1888 } |
OLD | NEW |