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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2226 | 2229 |
2227 void RenderViewHostImpl::OnDomOperationResponse( | 2230 void RenderViewHostImpl::OnDomOperationResponse( |
2228 const std::string& json_string, int automation_id) { | 2231 const std::string& json_string, int automation_id) { |
2229 DomOperationNotificationDetails details(json_string, automation_id); | 2232 DomOperationNotificationDetails details(json_string, automation_id); |
2230 NotificationService::current()->Notify( | 2233 NotificationService::current()->Notify( |
2231 NOTIFICATION_DOM_OPERATION_RESPONSE, | 2234 NOTIFICATION_DOM_OPERATION_RESPONSE, |
2232 Source<RenderViewHost>(this), | 2235 Source<RenderViewHost>(this), |
2233 Details<DomOperationNotificationDetails>(&details)); | 2236 Details<DomOperationNotificationDetails>(&details)); |
2234 } | 2237 } |
2235 | 2238 |
2239 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { | |
2240 #if defined(OS_WIN) && defined(USE_AURA) | |
2241 if (editable) { | |
2242 base::win::DisplayVirtualKeyboard(); | |
2243 } else { | |
2244 base::win::DismissVirtualKeyboard(); | |
2245 } | |
2246 #endif // | |
jam
2013/11/27 22:22:01
?
ananta
2013/11/27 22:57:14
Done.
| |
2247 } | |
2248 | |
2236 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 2249 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
2237 void RenderViewHostImpl::OnShowPopup( | 2250 void RenderViewHostImpl::OnShowPopup( |
2238 const ViewHostMsg_ShowPopup_Params& params) { | 2251 const ViewHostMsg_ShowPopup_Params& params) { |
2239 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); | 2252 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); |
2240 if (view) { | 2253 if (view) { |
2241 view->ShowPopupMenu(params.bounds, | 2254 view->ShowPopupMenu(params.bounds, |
2242 params.item_height, | 2255 params.item_height, |
2243 params.item_font_size, | 2256 params.item_font_size, |
2244 params.selected_item, | 2257 params.selected_item, |
2245 params.popup_items, | 2258 params.popup_items, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2284 void RenderViewHostImpl::AttachToFrameTree() { | 2297 void RenderViewHostImpl::AttachToFrameTree() { |
2285 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2298 FrameTree* frame_tree = delegate_->GetFrameTree(); |
2286 | 2299 |
2287 frame_tree->SwapMainFrame(main_render_frame_host_.get()); | 2300 frame_tree->SwapMainFrame(main_render_frame_host_.get()); |
2288 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2301 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
2289 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2302 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
2290 } | 2303 } |
2291 } | 2304 } |
2292 | 2305 |
2293 } // namespace content | 2306 } // namespace content |
OLD | NEW |