OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer/render_widget.h" | 5 #include "chrome/renderer/render_widget.h" |
6 | 6 |
7 #include "app/surface/transport_dib.h" | 7 #include "app/surface/transport_dib.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/render_messages.h" | 15 #include "chrome/common/render_messages.h" |
16 #include "chrome/common/render_messages_params.h" | 16 #include "chrome/common/render_messages_params.h" |
17 #include "chrome/renderer/render_process.h" | 17 #include "chrome/renderer/render_process.h" |
18 #include "chrome/renderer/render_thread.h" | 18 #include "chrome/renderer/render_thread.h" |
19 #include "gfx/point.h" | 19 #include "gfx/point.h" |
20 #include "gfx/size.h" | 20 #include "gfx/size.h" |
21 #include "ipc/ipc_sync_message.h" | 21 #include "ipc/ipc_sync_message.h" |
22 #include "skia/ext/platform_canvas.h" | 22 #include "skia/ext/platform_canvas.h" |
23 #include "third_party/skia/include/core/SkShader.h" | 23 #include "third_party/skia/include/core/SkShader.h" |
24 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" | 24 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" |
25 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenu.h" | 25 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenu.h" |
26 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenuInfo.h" | 26 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenuInfo.h" |
27 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 27 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
28 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" | 28 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" |
29 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" |
30 #include "webkit/glue/plugins/webplugin.h" | |
31 #include "webkit/glue/webkit_glue.h" | 30 #include "webkit/glue/webkit_glue.h" |
| 31 #include "webkit/plugins/npapi/webplugin.h" |
32 | 32 |
33 #if defined(OS_POSIX) | 33 #if defined(OS_POSIX) |
34 #include "ipc/ipc_channel_posix.h" | 34 #include "ipc/ipc_channel_posix.h" |
35 #include "third_party/skia/include/core/SkPixelRef.h" | 35 #include "third_party/skia/include/core/SkPixelRef.h" |
36 #include "third_party/skia/include/core/SkMallocPixelRef.h" | 36 #include "third_party/skia/include/core/SkMallocPixelRef.h" |
37 #endif // defined(OS_POSIX) | 37 #endif // defined(OS_POSIX) |
38 | 38 |
39 #include "third_party/WebKit/WebKit/chromium/public/WebWidget.h" | 39 #include "third_party/WebKit/WebKit/chromium/public/WebWidget.h" |
40 | 40 |
41 using WebKit::WebCompositionUnderline; | 41 using WebKit::WebCompositionUnderline; |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 // ongoing composition regardless of the new text input type. | 948 // ongoing composition regardless of the new text input type. |
949 if (text_input_type_ != WebKit::WebTextInputTypeNone) { | 949 if (text_input_type_ != WebKit::WebTextInputTypeNone) { |
950 // If a composition text exists, then we need to let the browser process | 950 // If a composition text exists, then we need to let the browser process |
951 // to cancel the input method's ongoing composition session. | 951 // to cancel the input method's ongoing composition session. |
952 if (webwidget_->confirmComposition()) | 952 if (webwidget_->confirmComposition()) |
953 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); | 953 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); |
954 } | 954 } |
955 } | 955 } |
956 | 956 |
957 void RenderWidget::SchedulePluginMove( | 957 void RenderWidget::SchedulePluginMove( |
958 const webkit_glue::WebPluginGeometry& move) { | 958 const webkit::npapi::WebPluginGeometry& move) { |
959 size_t i = 0; | 959 size_t i = 0; |
960 for (; i < plugin_window_moves_.size(); ++i) { | 960 for (; i < plugin_window_moves_.size(); ++i) { |
961 if (plugin_window_moves_[i].window == move.window) { | 961 if (plugin_window_moves_[i].window == move.window) { |
962 if (move.rects_valid) { | 962 if (move.rects_valid) { |
963 plugin_window_moves_[i] = move; | 963 plugin_window_moves_[i] = move; |
964 } else { | 964 } else { |
965 plugin_window_moves_[i].visible = move.visible; | 965 plugin_window_moves_[i].visible = move.visible; |
966 } | 966 } |
967 break; | 967 break; |
968 } | 968 } |
969 } | 969 } |
970 | 970 |
971 if (i == plugin_window_moves_.size()) | 971 if (i == plugin_window_moves_.size()) |
972 plugin_window_moves_.push_back(move); | 972 plugin_window_moves_.push_back(move); |
973 } | 973 } |
974 | 974 |
975 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 975 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
976 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 976 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
977 i != plugin_window_moves_.end(); ++i) { | 977 i != plugin_window_moves_.end(); ++i) { |
978 if (i->window == window) { | 978 if (i->window == window) { |
979 plugin_window_moves_.erase(i); | 979 plugin_window_moves_.erase(i); |
980 break; | 980 break; |
981 } | 981 } |
982 } | 982 } |
983 } | 983 } |
OLD | NEW |