| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #include "ui/base/ui_base_switches.h" | 77 #include "ui/base/ui_base_switches.h" |
| 78 #include "ui/gfx/image/image_skia.h" | 78 #include "ui/gfx/image/image_skia.h" |
| 79 #include "ui/gfx/native_widget_types.h" | 79 #include "ui/gfx/native_widget_types.h" |
| 80 #include "ui/shell_dialogs/selected_file_info.h" | 80 #include "ui/shell_dialogs/selected_file_info.h" |
| 81 #include "webkit/browser/fileapi/isolated_context.h" | 81 #include "webkit/browser/fileapi/isolated_context.h" |
| 82 | 82 |
| 83 #if defined(OS_MACOSX) | 83 #if defined(OS_MACOSX) |
| 84 #include "content/browser/renderer_host/popup_menu_helper_mac.h" | 84 #include "content/browser/renderer_host/popup_menu_helper_mac.h" |
| 85 #elif defined(OS_ANDROID) | 85 #elif defined(OS_ANDROID) |
| 86 #include "content/browser/media/android/browser_media_player_manager.h" | 86 #include "content/browser/media/android/browser_media_player_manager.h" |
| 87 #elif defined(OS_WIN) |
| 88 #include "base/win/win_util.h" |
| 87 #endif | 89 #endif |
| 88 | 90 |
| 89 using base::TimeDelta; | 91 using base::TimeDelta; |
| 90 using blink::WebConsoleMessage; | 92 using blink::WebConsoleMessage; |
| 91 using blink::WebDragOperation; | 93 using blink::WebDragOperation; |
| 92 using blink::WebDragOperationNone; | 94 using blink::WebDragOperationNone; |
| 93 using blink::WebDragOperationsMask; | 95 using blink::WebDragOperationsMask; |
| 94 using blink::WebInputEvent; | 96 using blink::WebInputEvent; |
| 95 using blink::WebMediaPlayerAction; | 97 using blink::WebMediaPlayerAction; |
| 96 using blink::WebPluginAction; | 98 using blink::WebPluginAction; |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 OnCancelDesktopNotification) | 1257 OnCancelDesktopNotification) |
| 1256 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 1258 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 1257 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) | 1259 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) |
| 1258 #endif | 1260 #endif |
| 1259 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) | 1261 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) |
| 1260 IPC_MESSAGE_HANDLER(ViewHostMsg_DidAccessInitialDocument, | 1262 IPC_MESSAGE_HANDLER(ViewHostMsg_DidAccessInitialDocument, |
| 1261 OnDidAccessInitialDocument) | 1263 OnDidAccessInitialDocument) |
| 1262 IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse, | 1264 IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse, |
| 1263 OnDomOperationResponse) | 1265 OnDomOperationResponse) |
| 1264 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) | 1266 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) |
| 1267 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) |
| 1265 // Have the super handle all other messages. | 1268 // Have the super handle all other messages. |
| 1266 IPC_MESSAGE_UNHANDLED( | 1269 IPC_MESSAGE_UNHANDLED( |
| 1267 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) | 1270 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) |
| 1268 IPC_END_MESSAGE_MAP_EX() | 1271 IPC_END_MESSAGE_MAP_EX() |
| 1269 | 1272 |
| 1270 if (!msg_is_ok) { | 1273 if (!msg_is_ok) { |
| 1271 // The message had a handler, but its de-serialization failed. | 1274 // The message had a handler, but its de-serialization failed. |
| 1272 // Kill the renderer. | 1275 // Kill the renderer. |
| 1273 RecordAction(UserMetricsAction("BadMessageTerminate_RVH")); | 1276 RecordAction(UserMetricsAction("BadMessageTerminate_RVH")); |
| 1274 GetProcess()->ReceivedBadMessage(); | 1277 GetProcess()->ReceivedBadMessage(); |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2229 | 2232 |
| 2230 void RenderViewHostImpl::OnDomOperationResponse( | 2233 void RenderViewHostImpl::OnDomOperationResponse( |
| 2231 const std::string& json_string, int automation_id) { | 2234 const std::string& json_string, int automation_id) { |
| 2232 DomOperationNotificationDetails details(json_string, automation_id); | 2235 DomOperationNotificationDetails details(json_string, automation_id); |
| 2233 NotificationService::current()->Notify( | 2236 NotificationService::current()->Notify( |
| 2234 NOTIFICATION_DOM_OPERATION_RESPONSE, | 2237 NOTIFICATION_DOM_OPERATION_RESPONSE, |
| 2235 Source<RenderViewHost>(this), | 2238 Source<RenderViewHost>(this), |
| 2236 Details<DomOperationNotificationDetails>(&details)); | 2239 Details<DomOperationNotificationDetails>(&details)); |
| 2237 } | 2240 } |
| 2238 | 2241 |
| 2242 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { |
| 2243 #if defined(OS_WIN) && defined(USE_AURA) |
| 2244 if (editable) { |
| 2245 base::win::DisplayVirtualKeyboard(); |
| 2246 } else { |
| 2247 base::win::DismissVirtualKeyboard(); |
| 2248 } |
| 2249 #endif |
| 2250 } |
| 2251 |
| 2239 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 2252 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 2240 void RenderViewHostImpl::OnShowPopup( | 2253 void RenderViewHostImpl::OnShowPopup( |
| 2241 const ViewHostMsg_ShowPopup_Params& params) { | 2254 const ViewHostMsg_ShowPopup_Params& params) { |
| 2242 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); | 2255 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); |
| 2243 if (view) { | 2256 if (view) { |
| 2244 view->ShowPopupMenu(params.bounds, | 2257 view->ShowPopupMenu(params.bounds, |
| 2245 params.item_height, | 2258 params.item_height, |
| 2246 params.item_font_size, | 2259 params.item_font_size, |
| 2247 params.selected_item, | 2260 params.selected_item, |
| 2248 params.popup_items, | 2261 params.popup_items, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2287 void RenderViewHostImpl::AttachToFrameTree() { | 2300 void RenderViewHostImpl::AttachToFrameTree() { |
| 2288 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2301 FrameTree* frame_tree = delegate_->GetFrameTree(); |
| 2289 | 2302 |
| 2290 frame_tree->SwapMainFrame(main_render_frame_host_.get()); | 2303 frame_tree->SwapMainFrame(main_render_frame_host_.get()); |
| 2291 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2304 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
| 2292 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2305 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
| 2293 } | 2306 } |
| 2294 } | 2307 } |
| 2295 | 2308 |
| 2296 } // namespace content | 2309 } // namespace content |
| OLD | NEW |