OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <InputScope.h> | 7 #include <InputScope.h> |
8 #include <wtsapi32.h> | 8 #include <wtsapi32.h> |
9 #pragma comment(lib, "wtsapi32.lib") | 9 #pragma comment(lib, "wtsapi32.lib") |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "skia/ext/skia_utils_win.h" | 56 #include "skia/ext/skia_utils_win.h" |
57 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 57 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
58 #include "third_party/WebKit/public/web/WebInputEvent.h" | 58 #include "third_party/WebKit/public/web/WebInputEvent.h" |
59 #include "third_party/skia/include/core/SkRegion.h" | 59 #include "third_party/skia/include/core/SkRegion.h" |
60 #include "ui/base/events/event.h" | 60 #include "ui/base/events/event.h" |
61 #include "ui/base/events/event_utils.h" | 61 #include "ui/base/events/event_utils.h" |
62 #include "ui/base/ime/composition_text.h" | 62 #include "ui/base/ime/composition_text.h" |
63 #include "ui/base/ime/win/imm32_manager.h" | 63 #include "ui/base/ime/win/imm32_manager.h" |
64 #include "ui/base/ime/win/tsf_input_scope.h" | 64 #include "ui/base/ime/win/tsf_input_scope.h" |
65 #include "ui/base/l10n/l10n_util_win.h" | 65 #include "ui/base/l10n/l10n_util_win.h" |
66 #include "ui/base/text/text_elider.h" | |
67 #include "ui/base/touch/touch_device.h" | 66 #include "ui/base/touch/touch_device.h" |
68 #include "ui/base/touch/touch_enabled.h" | 67 #include "ui/base/touch/touch_enabled.h" |
69 #include "ui/base/ui_base_switches.h" | 68 #include "ui/base/ui_base_switches.h" |
70 #include "ui/base/view_prop.h" | 69 #include "ui/base/view_prop.h" |
71 #include "ui/base/win/dpi.h" | 70 #include "ui/base/win/dpi.h" |
72 #include "ui/base/win/hwnd_util.h" | 71 #include "ui/base/win/hwnd_util.h" |
73 #include "ui/base/win/mouse_wheel_util.h" | 72 #include "ui/base/win/mouse_wheel_util.h" |
74 #include "ui/base/win/touch_input.h" | 73 #include "ui/base/win/touch_input.h" |
75 #include "ui/gfx/canvas.h" | 74 #include "ui/gfx/canvas.h" |
76 #include "ui/gfx/rect.h" | 75 #include "ui/gfx/rect.h" |
77 #include "ui/gfx/rect_conversions.h" | 76 #include "ui/gfx/rect_conversions.h" |
78 #include "ui/gfx/screen.h" | 77 #include "ui/gfx/screen.h" |
| 78 #include "ui/gfx/text_elider.h" |
79 #include "webkit/common/cursors/webcursor.h" | 79 #include "webkit/common/cursors/webcursor.h" |
80 #include "win8/util/win8_util.h" | 80 #include "win8/util/win8_util.h" |
81 | 81 |
82 using base::TimeDelta; | 82 using base::TimeDelta; |
83 using base::TimeTicks; | 83 using base::TimeTicks; |
84 using ui::ViewProp; | 84 using ui::ViewProp; |
85 using WebKit::WebInputEvent; | 85 using WebKit::WebInputEvent; |
86 using WebKit::WebMouseEvent; | 86 using WebKit::WebMouseEvent; |
87 using WebKit::WebTextDirection; | 87 using WebKit::WebTextDirection; |
88 | 88 |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 } | 839 } |
840 | 840 |
841 void RenderWidgetHostViewWin::SetTooltipText(const string16& tooltip_text) { | 841 void RenderWidgetHostViewWin::SetTooltipText(const string16& tooltip_text) { |
842 if (!is_hidden_) | 842 if (!is_hidden_) |
843 EnsureTooltip(); | 843 EnsureTooltip(); |
844 | 844 |
845 // Clamp the tooltip length to kMaxTooltipLength so that we don't | 845 // Clamp the tooltip length to kMaxTooltipLength so that we don't |
846 // accidentally DOS the user with a mega tooltip (since Windows doesn't seem | 846 // accidentally DOS the user with a mega tooltip (since Windows doesn't seem |
847 // to do this itself). | 847 // to do this itself). |
848 const string16 new_tooltip_text = | 848 const string16 new_tooltip_text = |
849 ui::TruncateString(tooltip_text, kMaxTooltipLength); | 849 gfx::TruncateString(tooltip_text, kMaxTooltipLength); |
850 | 850 |
851 if (new_tooltip_text != tooltip_text_) { | 851 if (new_tooltip_text != tooltip_text_) { |
852 tooltip_text_ = new_tooltip_text; | 852 tooltip_text_ = new_tooltip_text; |
853 | 853 |
854 // Need to check if the tooltip is already showing so that we don't | 854 // Need to check if the tooltip is already showing so that we don't |
855 // immediately show the tooltip with no delay when we move the mouse from | 855 // immediately show the tooltip with no delay when we move the mouse from |
856 // a region with no tooltip to a region with a tooltip. | 856 // a region with no tooltip to a region with a tooltip. |
857 if (::IsWindow(tooltip_hwnd_) && tooltip_showing_) { | 857 if (::IsWindow(tooltip_hwnd_) && tooltip_showing_) { |
858 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); | 858 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); |
859 ::SendMessage(tooltip_hwnd_, TTM_POPUP, 0, 0); | 859 ::SendMessage(tooltip_hwnd_, TTM_POPUP, 0, 0); |
(...skipping 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3199 return new RenderWidgetHostViewWin(widget); | 3199 return new RenderWidgetHostViewWin(widget); |
3200 } | 3200 } |
3201 | 3201 |
3202 // static | 3202 // static |
3203 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 3203 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
3204 WebKit::WebScreenInfo* results) { | 3204 WebKit::WebScreenInfo* results) { |
3205 GetScreenInfoForWindow(0, results); | 3205 GetScreenInfoForWindow(0, results); |
3206 } | 3206 } |
3207 | 3207 |
3208 } // namespace content | 3208 } // namespace content |
OLD | NEW |