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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #include "content/common/inter_process_time_ticks_converter.h" | 49 #include "content/common/inter_process_time_ticks_converter.h" |
50 #include "content/common/speech_recognition_messages.h" | 50 #include "content/common/speech_recognition_messages.h" |
51 #include "content/common/swapped_out_messages.h" | 51 #include "content/common/swapped_out_messages.h" |
52 #include "content/common/view_messages.h" | 52 #include "content/common/view_messages.h" |
53 #include "content/port/browser/render_view_host_delegate_view.h" | 53 #include "content/port/browser/render_view_host_delegate_view.h" |
54 #include "content/port/browser/render_widget_host_view_port.h" | 54 #include "content/port/browser/render_widget_host_view_port.h" |
55 #include "content/public/browser/browser_accessibility_state.h" | 55 #include "content/public/browser/browser_accessibility_state.h" |
56 #include "content/public/browser/browser_context.h" | 56 #include "content/public/browser/browser_context.h" |
57 #include "content/public/browser/browser_message_filter.h" | 57 #include "content/public/browser/browser_message_filter.h" |
58 #include "content/public/browser/content_browser_client.h" | 58 #include "content/public/browser/content_browser_client.h" |
59 #include "content/public/browser/dom_operation_notification_details.h" | |
60 #include "content/public/browser/native_web_keyboard_event.h" | 59 #include "content/public/browser/native_web_keyboard_event.h" |
61 #include "content/public/browser/notification_details.h" | 60 #include "content/public/browser/notification_details.h" |
62 #include "content/public/browser/notification_service.h" | 61 #include "content/public/browser/notification_service.h" |
63 #include "content/public/browser/notification_types.h" | 62 #include "content/public/browser/notification_types.h" |
64 #include "content/public/browser/render_frame_host.h" | 63 #include "content/public/browser/render_frame_host.h" |
65 #include "content/public/browser/render_widget_host_iterator.h" | 64 #include "content/public/browser/render_widget_host_iterator.h" |
66 #include "content/public/browser/user_metrics.h" | 65 #include "content/public/browser/user_metrics.h" |
67 #include "content/public/common/bindings_policy.h" | 66 #include "content/public/common/bindings_policy.h" |
68 #include "content/public/common/content_constants.h" | 67 #include "content/public/common/content_constants.h" |
69 #include "content/public/common/content_switches.h" | 68 #include "content/public/common/content_switches.h" |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, | 1294 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, |
1296 OnShowDesktopNotification) | 1295 OnShowDesktopNotification) |
1297 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel, | 1296 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel, |
1298 OnCancelDesktopNotification) | 1297 OnCancelDesktopNotification) |
1299 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 1298 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
1300 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) | 1299 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) |
1301 #endif | 1300 #endif |
1302 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) | 1301 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) |
1303 IPC_MESSAGE_HANDLER(ViewHostMsg_DidAccessInitialDocument, | 1302 IPC_MESSAGE_HANDLER(ViewHostMsg_DidAccessInitialDocument, |
1304 OnDidAccessInitialDocument) | 1303 OnDidAccessInitialDocument) |
1305 IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse, | |
1306 OnDomOperationResponse) | |
1307 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) | 1304 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) |
1308 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, | 1305 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, |
1309 OnAccessibilityLocationChanges) | 1306 OnAccessibilityLocationChanges) |
1310 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) | 1307 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) |
1311 // Have the super handle all other messages. | 1308 // Have the super handle all other messages. |
1312 IPC_MESSAGE_UNHANDLED( | 1309 IPC_MESSAGE_UNHANDLED( |
1313 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) | 1310 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) |
1314 IPC_END_MESSAGE_MAP_EX() | 1311 IPC_END_MESSAGE_MAP_EX() |
1315 | 1312 |
1316 if (!msg_is_ok) { | 1313 if (!msg_is_ok) { |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2080 | 2077 |
2081 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { | 2078 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { |
2082 delegate_->RunFileChooser(this, params); | 2079 delegate_->RunFileChooser(this, params); |
2083 } | 2080 } |
2084 | 2081 |
2085 void RenderViewHostImpl::OnDidAccessInitialDocument() { | 2082 void RenderViewHostImpl::OnDidAccessInitialDocument() { |
2086 has_accessed_initial_document_ = true; | 2083 has_accessed_initial_document_ = true; |
2087 delegate_->DidAccessInitialDocument(); | 2084 delegate_->DidAccessInitialDocument(); |
2088 } | 2085 } |
2089 | 2086 |
2090 void RenderViewHostImpl::OnDomOperationResponse( | |
2091 const std::string& json_string, int automation_id) { | |
2092 DomOperationNotificationDetails details(json_string, automation_id); | |
2093 NotificationService::current()->Notify( | |
2094 NOTIFICATION_DOM_OPERATION_RESPONSE, | |
2095 Source<RenderViewHost>(this), | |
2096 Details<DomOperationNotificationDetails>(&details)); | |
2097 } | |
2098 | |
2099 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { | 2087 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { |
2100 #if defined(OS_WIN) | 2088 #if defined(OS_WIN) |
2101 if (editable) { | 2089 if (editable) { |
2102 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard(); | 2090 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard(); |
2103 } else { | 2091 } else { |
2104 virtual_keyboard_requested_ = false; | 2092 virtual_keyboard_requested_ = false; |
2105 base::win::DismissVirtualKeyboard(); | 2093 base::win::DismissVirtualKeyboard(); |
2106 } | 2094 } |
2107 #endif | 2095 #endif |
2108 } | 2096 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 void RenderViewHostImpl::AttachToFrameTree() { | 2149 void RenderViewHostImpl::AttachToFrameTree() { |
2162 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2150 FrameTree* frame_tree = delegate_->GetFrameTree(); |
2163 | 2151 |
2164 frame_tree->ResetForMainFrameSwap(); | 2152 frame_tree->ResetForMainFrameSwap(); |
2165 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2153 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
2166 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2154 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
2167 } | 2155 } |
2168 } | 2156 } |
2169 | 2157 |
2170 } // namespace content | 2158 } // namespace content |
OLD | NEW |