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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 MetroCloseFrameWindow close_frame_window = | 829 MetroCloseFrameWindow close_frame_window = |
830 reinterpret_cast<MetroCloseFrameWindow>( | 830 reinterpret_cast<MetroCloseFrameWindow>( |
831 ::GetProcAddress(base::win::GetMetroModule(), "CloseFrameWindow")); | 831 ::GetProcAddress(base::win::GetMetroModule(), "CloseFrameWindow")); |
832 DCHECK(close_frame_window); | 832 DCHECK(close_frame_window); |
833 close_frame_window(m_hWnd); | 833 close_frame_window(m_hWnd); |
834 } | 834 } |
835 | 835 |
836 DestroyWindow(); | 836 DestroyWindow(); |
837 } | 837 } |
838 | 838 |
839 void RenderWidgetHostViewWin::SetTooltipText(const string16& tooltip_text) { | 839 void RenderWidgetHostViewWin::SetTooltipText( |
| 840 const base::string16& tooltip_text) { |
840 if (!render_widget_host_->is_hidden()) | 841 if (!render_widget_host_->is_hidden()) |
841 EnsureTooltip(); | 842 EnsureTooltip(); |
842 | 843 |
843 // Clamp the tooltip length to kMaxTooltipLength so that we don't | 844 // Clamp the tooltip length to kMaxTooltipLength so that we don't |
844 // accidentally DOS the user with a mega tooltip (since Windows doesn't seem | 845 // accidentally DOS the user with a mega tooltip (since Windows doesn't seem |
845 // to do this itself). | 846 // to do this itself). |
846 const string16 new_tooltip_text = | 847 const base::string16 new_tooltip_text = |
847 gfx::TruncateString(tooltip_text, kMaxTooltipLength); | 848 gfx::TruncateString(tooltip_text, kMaxTooltipLength); |
848 | 849 |
849 if (new_tooltip_text != tooltip_text_) { | 850 if (new_tooltip_text != tooltip_text_) { |
850 tooltip_text_ = new_tooltip_text; | 851 tooltip_text_ = new_tooltip_text; |
851 | 852 |
852 // Need to check if the tooltip is already showing so that we don't | 853 // Need to check if the tooltip is already showing so that we don't |
853 // immediately show the tooltip with no delay when we move the mouse from | 854 // immediately show the tooltip with no delay when we move the mouse from |
854 // a region with no tooltip to a region with a tooltip. | 855 // a region with no tooltip to a region with a tooltip. |
855 if (::IsWindow(tooltip_hwnd_) && tooltip_showing_) { | 856 if (::IsWindow(tooltip_hwnd_) && tooltip_showing_) { |
856 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); | 857 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 | 1011 |
1011 void RenderWidgetHostViewWin::ClearCompositionText() { | 1012 void RenderWidgetHostViewWin::ClearCompositionText() { |
1012 if (!base::win::IsTSFAwareRequired()) { | 1013 if (!base::win::IsTSFAwareRequired()) { |
1013 NOTREACHED(); | 1014 NOTREACHED(); |
1014 return; | 1015 return; |
1015 } | 1016 } |
1016 // TODO(nona): Implement this function. | 1017 // TODO(nona): Implement this function. |
1017 NOTIMPLEMENTED(); | 1018 NOTIMPLEMENTED(); |
1018 } | 1019 } |
1019 | 1020 |
1020 void RenderWidgetHostViewWin::InsertText(const string16& text) { | 1021 void RenderWidgetHostViewWin::InsertText(const base::string16& text) { |
1021 if (!base::win::IsTSFAwareRequired()) { | 1022 if (!base::win::IsTSFAwareRequired()) { |
1022 NOTREACHED(); | 1023 NOTREACHED(); |
1023 return; | 1024 return; |
1024 } | 1025 } |
1025 if (render_widget_host_) | 1026 if (render_widget_host_) |
1026 render_widget_host_->ImeConfirmComposition(text, | 1027 render_widget_host_->ImeConfirmComposition(text, |
1027 gfx::Range::InvalidRange(), | 1028 gfx::Range::InvalidRange(), |
1028 false); | 1029 false); |
1029 } | 1030 } |
1030 | 1031 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 if (!base::win::IsTSFAwareRequired()) { | 1147 if (!base::win::IsTSFAwareRequired()) { |
1147 NOTREACHED(); | 1148 NOTREACHED(); |
1148 return false; | 1149 return false; |
1149 } | 1150 } |
1150 // TODO(nona): Implement this function. | 1151 // TODO(nona): Implement this function. |
1151 NOTIMPLEMENTED(); | 1152 NOTIMPLEMENTED(); |
1152 return false; | 1153 return false; |
1153 } | 1154 } |
1154 | 1155 |
1155 bool RenderWidgetHostViewWin::GetTextFromRange(const gfx::Range& range, | 1156 bool RenderWidgetHostViewWin::GetTextFromRange(const gfx::Range& range, |
1156 string16* text) const { | 1157 base::string16* text) const { |
1157 if (!base::win::IsTSFAwareRequired()) { | 1158 if (!base::win::IsTSFAwareRequired()) { |
1158 NOTREACHED(); | 1159 NOTREACHED(); |
1159 return false; | 1160 return false; |
1160 } | 1161 } |
1161 gfx::Range selection_text_range(selection_text_offset_, | 1162 gfx::Range selection_text_range(selection_text_offset_, |
1162 selection_text_offset_ + selection_text_.length()); | 1163 selection_text_offset_ + selection_text_.length()); |
1163 if (!selection_text_range.Contains(range)) { | 1164 if (!selection_text_range.Contains(range)) { |
1164 text->clear(); | 1165 text->clear(); |
1165 return false; | 1166 return false; |
1166 } | 1167 } |
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3215 return new RenderWidgetHostViewWin(widget); | 3216 return new RenderWidgetHostViewWin(widget); |
3216 } | 3217 } |
3217 | 3218 |
3218 // static | 3219 // static |
3219 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 3220 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
3220 blink::WebScreenInfo* results) { | 3221 blink::WebScreenInfo* results) { |
3221 GetScreenInfoForWindow(0, results); | 3222 GetScreenInfoForWindow(0, results); |
3222 } | 3223 } |
3223 | 3224 |
3224 } // namespace content | 3225 } // namespace content |
OLD | NEW |