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 "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/utf_string_conversions.h" |
13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
14 #include "content/common/content_switches.h" | 15 #include "content/common/content_switches.h" |
15 #include "content/common/swapped_out_messages.h" | 16 #include "content/common/swapped_out_messages.h" |
16 #include "content/common/view_messages.h" | 17 #include "content/common/view_messages.h" |
17 #include "content/renderer/render_process.h" | 18 #include "content/renderer/render_process.h" |
18 #include "content/renderer/render_thread.h" | 19 #include "content/renderer/render_thread.h" |
19 #include "content/renderer/renderer_webkitclient_impl.h" | 20 #include "content/renderer/renderer_webkitclient_impl.h" |
20 #include "ipc/ipc_sync_message.h" | 21 #include "ipc/ipc_sync_message.h" |
21 #include "skia/ext/platform_canvas.h" | 22 #include "skia/ext/platform_canvas.h" |
22 #include "third_party/skia/include/core/SkShader.h" | 23 #include "third_party/skia/include/core/SkShader.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
30 #include "ui/gfx/point.h" | 32 #include "ui/gfx/point.h" |
31 #include "ui/gfx/size.h" | 33 #include "ui/gfx/size.h" |
32 #include "ui/gfx/surface/transport_dib.h" | 34 #include "ui/gfx/surface/transport_dib.h" |
33 #include "webkit/glue/webkit_glue.h" | 35 #include "webkit/glue/webkit_glue.h" |
34 #include "webkit/plugins/npapi/webplugin.h" | 36 #include "webkit/plugins/npapi/webplugin.h" |
35 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 37 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
36 | 38 |
37 #if defined(OS_POSIX) | 39 #if defined(OS_POSIX) |
38 #include "ipc/ipc_channel_posix.h" | 40 #include "ipc/ipc_channel_posix.h" |
39 #include "third_party/skia/include/core/SkPixelRef.h" | 41 #include "third_party/skia/include/core/SkPixelRef.h" |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 | 982 |
981 WebRect RenderWidget::windowRect() { | 983 WebRect RenderWidget::windowRect() { |
982 if (pending_window_rect_count_) | 984 if (pending_window_rect_count_) |
983 return pending_window_rect_; | 985 return pending_window_rect_; |
984 | 986 |
985 gfx::Rect rect; | 987 gfx::Rect rect; |
986 Send(new ViewHostMsg_GetWindowRect(routing_id_, host_window_, &rect)); | 988 Send(new ViewHostMsg_GetWindowRect(routing_id_, host_window_, &rect)); |
987 return rect; | 989 return rect; |
988 } | 990 } |
989 | 991 |
| 992 void RenderWidget::setToolTipText(const WebKit::WebString& text, |
| 993 WebTextDirection hint) { |
| 994 Send(new ViewHostMsg_SetTooltipText(routing_id_, UTF16ToWideHack(text), |
| 995 hint)); |
| 996 } |
| 997 |
990 void RenderWidget::setWindowRect(const WebRect& pos) { | 998 void RenderWidget::setWindowRect(const WebRect& pos) { |
991 if (did_show_) { | 999 if (did_show_) { |
992 Send(new ViewHostMsg_RequestMove(routing_id_, pos)); | 1000 Send(new ViewHostMsg_RequestMove(routing_id_, pos)); |
993 SetPendingWindowRect(pos); | 1001 SetPendingWindowRect(pos); |
994 } else { | 1002 } else { |
995 initial_pos_ = pos; | 1003 initial_pos_ = pos; |
996 } | 1004 } |
997 } | 1005 } |
998 | 1006 |
999 void RenderWidget::SetPendingWindowRect(const WebRect& rect) { | 1007 void RenderWidget::SetPendingWindowRect(const WebRect& rect) { |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 | 1314 |
1307 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 1315 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
1308 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 1316 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
1309 i != plugin_window_moves_.end(); ++i) { | 1317 i != plugin_window_moves_.end(); ++i) { |
1310 if (i->window == window) { | 1318 if (i->window == window) { |
1311 plugin_window_moves_.erase(i); | 1319 plugin_window_moves_.erase(i); |
1312 break; | 1320 break; |
1313 } | 1321 } |
1314 } | 1322 } |
1315 } | 1323 } |
OLD | NEW |