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_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 #include "ui/base/ui_base_switches.h" | 76 #include "ui/base/ui_base_switches.h" |
77 #include "ui/gfx/image/image_skia.h" | 77 #include "ui/gfx/image/image_skia.h" |
78 #include "ui/gfx/native_widget_types.h" | 78 #include "ui/gfx/native_widget_types.h" |
79 #include "ui/shell_dialogs/selected_file_info.h" | 79 #include "ui/shell_dialogs/selected_file_info.h" |
80 #include "webkit/browser/fileapi/isolated_context.h" | 80 #include "webkit/browser/fileapi/isolated_context.h" |
81 | 81 |
82 #if defined(OS_MACOSX) | 82 #if defined(OS_MACOSX) |
83 #include "content/browser/renderer_host/popup_menu_helper_mac.h" | 83 #include "content/browser/renderer_host/popup_menu_helper_mac.h" |
84 #elif defined(OS_ANDROID) | 84 #elif defined(OS_ANDROID) |
85 #include "content/browser/media/android/browser_media_player_manager.h" | 85 #include "content/browser/media/android/browser_media_player_manager.h" |
| 86 #elif defined(OS_WIN) |
| 87 #include "base/win/win_util.h" |
86 #endif | 88 #endif |
87 | 89 |
88 using base::TimeDelta; | 90 using base::TimeDelta; |
89 using WebKit::WebConsoleMessage; | 91 using WebKit::WebConsoleMessage; |
90 using WebKit::WebDragOperation; | 92 using WebKit::WebDragOperation; |
91 using WebKit::WebDragOperationNone; | 93 using WebKit::WebDragOperationNone; |
92 using WebKit::WebDragOperationsMask; | 94 using WebKit::WebDragOperationsMask; |
93 using WebKit::WebInputEvent; | 95 using WebKit::WebInputEvent; |
94 using WebKit::WebMediaPlayerAction; | 96 using WebKit::WebMediaPlayerAction; |
95 using WebKit::WebPluginAction; | 97 using WebKit::WebPluginAction; |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 OnCancelDesktopNotification) | 1222 OnCancelDesktopNotification) |
1221 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 1223 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
1222 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) | 1224 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) |
1223 #endif | 1225 #endif |
1224 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) | 1226 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) |
1225 IPC_MESSAGE_HANDLER(ViewHostMsg_DidAccessInitialDocument, | 1227 IPC_MESSAGE_HANDLER(ViewHostMsg_DidAccessInitialDocument, |
1226 OnDidAccessInitialDocument) | 1228 OnDidAccessInitialDocument) |
1227 IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse, | 1229 IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse, |
1228 OnDomOperationResponse) | 1230 OnDomOperationResponse) |
1229 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) | 1231 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) |
| 1232 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) |
1230 // Have the super handle all other messages. | 1233 // Have the super handle all other messages. |
1231 IPC_MESSAGE_UNHANDLED( | 1234 IPC_MESSAGE_UNHANDLED( |
1232 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) | 1235 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) |
1233 IPC_END_MESSAGE_MAP_EX() | 1236 IPC_END_MESSAGE_MAP_EX() |
1234 | 1237 |
1235 if (!msg_is_ok) { | 1238 if (!msg_is_ok) { |
1236 // The message had a handler, but its de-serialization failed. | 1239 // The message had a handler, but its de-serialization failed. |
1237 // Kill the renderer. | 1240 // Kill the renderer. |
1238 RecordAction(UserMetricsAction("BadMessageTerminate_RVH")); | 1241 RecordAction(UserMetricsAction("BadMessageTerminate_RVH")); |
1239 GetProcess()->ReceivedBadMessage(); | 1242 GetProcess()->ReceivedBadMessage(); |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2191 | 2194 |
2192 void RenderViewHostImpl::OnDomOperationResponse( | 2195 void RenderViewHostImpl::OnDomOperationResponse( |
2193 const std::string& json_string, int automation_id) { | 2196 const std::string& json_string, int automation_id) { |
2194 DomOperationNotificationDetails details(json_string, automation_id); | 2197 DomOperationNotificationDetails details(json_string, automation_id); |
2195 NotificationService::current()->Notify( | 2198 NotificationService::current()->Notify( |
2196 NOTIFICATION_DOM_OPERATION_RESPONSE, | 2199 NOTIFICATION_DOM_OPERATION_RESPONSE, |
2197 Source<RenderViewHost>(this), | 2200 Source<RenderViewHost>(this), |
2198 Details<DomOperationNotificationDetails>(&details)); | 2201 Details<DomOperationNotificationDetails>(&details)); |
2199 } | 2202 } |
2200 | 2203 |
| 2204 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { |
| 2205 #if defined(OS_WIN) && defined(USE_AURA) |
| 2206 if (editable) { |
| 2207 base::win::DisplayVirtualKeyboard(); |
| 2208 } else { |
| 2209 base::win::DismissVirtualKeyboard(); |
| 2210 } |
| 2211 #endif |
| 2212 } |
| 2213 |
2201 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 2214 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
2202 void RenderViewHostImpl::OnShowPopup( | 2215 void RenderViewHostImpl::OnShowPopup( |
2203 const ViewHostMsg_ShowPopup_Params& params) { | 2216 const ViewHostMsg_ShowPopup_Params& params) { |
2204 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); | 2217 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); |
2205 if (view) { | 2218 if (view) { |
2206 view->ShowPopupMenu(params.bounds, | 2219 view->ShowPopupMenu(params.bounds, |
2207 params.item_height, | 2220 params.item_height, |
2208 params.item_font_size, | 2221 params.item_font_size, |
2209 params.selected_item, | 2222 params.selected_item, |
2210 params.popup_items, | 2223 params.popup_items, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 void RenderViewHostImpl::AttachToFrameTree() { | 2262 void RenderViewHostImpl::AttachToFrameTree() { |
2250 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2263 FrameTree* frame_tree = delegate_->GetFrameTree(); |
2251 | 2264 |
2252 frame_tree->SwapMainFrame(main_render_frame_host_.get()); | 2265 frame_tree->SwapMainFrame(main_render_frame_host_.get()); |
2253 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2266 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
2254 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2267 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
2255 } | 2268 } |
2256 } | 2269 } |
2257 | 2270 |
2258 } // namespace content | 2271 } // namespace content |
OLD | NEW |