OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/alias.h" | 11 #include "base/debug/alias.h" |
12 #include "base/debug/dump_without_crashing.h" | 12 #include "base/debug/dump_without_crashing.h" |
13 #include "base/i18n/char_iterator.h" | 13 #include "base/i18n/char_iterator.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "content/child/appcache/appcache_dispatcher.h" | 17 #include "content/child/appcache/appcache_dispatcher.h" |
18 #include "content/child/plugin_messages.h" | 18 #include "content/child/plugin_messages.h" |
19 #include "content/child/quota_dispatcher.h" | 19 #include "content/child/quota_dispatcher.h" |
20 #include "content/child/request_extra_data.h" | 20 #include "content/child/request_extra_data.h" |
21 #include "content/child/service_worker/web_service_worker_provider_impl.h" | 21 #include "content/child/service_worker/web_service_worker_provider_impl.h" |
22 #include "content/common/frame_messages.h" | 22 #include "content/common/frame_messages.h" |
23 #include "content/common/socket_stream_handle_data.h" | 23 #include "content/common/socket_stream_handle_data.h" |
24 #include "content/common/swapped_out_messages.h" | 24 #include "content/common/swapped_out_messages.h" |
25 #include "content/common/view_messages.h" | 25 #include "content/common/view_messages.h" |
26 #include "content/public/common/bindings_policy.h" | |
26 #include "content/public/common/content_constants.h" | 27 #include "content/public/common/content_constants.h" |
27 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
28 #include "content/public/common/context_menu_params.h" | 29 #include "content/public/common/context_menu_params.h" |
29 #include "content/public/common/url_constants.h" | 30 #include "content/public/common/url_constants.h" |
30 #include "content/public/common/url_utils.h" | 31 #include "content/public/common/url_utils.h" |
31 #include "content/public/renderer/content_renderer_client.h" | 32 #include "content/public/renderer/content_renderer_client.h" |
32 #include "content/public/renderer/context_menu_client.h" | 33 #include "content/public/renderer/context_menu_client.h" |
33 #include "content/public/renderer/document_state.h" | 34 #include "content/public/renderer/document_state.h" |
34 #include "content/public/renderer/history_item_serialization.h" | 35 #include "content/public/renderer/history_item_serialization.h" |
35 #include "content/public/renderer/navigation_state.h" | 36 #include "content/public/renderer/navigation_state.h" |
36 #include "content/public/renderer/render_frame_observer.h" | 37 #include "content/public/renderer/render_frame_observer.h" |
37 #include "content/renderer/accessibility/renderer_accessibility.h" | 38 #include "content/renderer/accessibility/renderer_accessibility.h" |
38 #include "content/renderer/browser_plugin/browser_plugin.h" | 39 #include "content/renderer/browser_plugin/browser_plugin.h" |
39 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 40 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
40 #include "content/renderer/child_frame_compositing_helper.h" | 41 #include "content/renderer/child_frame_compositing_helper.h" |
41 #include "content/renderer/context_menu_params_builder.h" | 42 #include "content/renderer/context_menu_params_builder.h" |
43 #include "content/renderer/dom_automation_controller.h" | |
42 #include "content/renderer/internal_document_state_data.h" | 44 #include "content/renderer/internal_document_state_data.h" |
43 #include "content/renderer/npapi/plugin_channel_host.h" | 45 #include "content/renderer/npapi/plugin_channel_host.h" |
44 #include "content/renderer/render_thread_impl.h" | 46 #include "content/renderer/render_thread_impl.h" |
45 #include "content/renderer/render_view_impl.h" | 47 #include "content/renderer/render_view_impl.h" |
46 #include "content/renderer/render_widget_fullscreen_pepper.h" | 48 #include "content/renderer/render_widget_fullscreen_pepper.h" |
47 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 49 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
48 #include "content/renderer/shared_worker_repository.h" | 50 #include "content/renderer/shared_worker_repository.h" |
49 #include "content/renderer/websharedworker_proxy.h" | 51 #include "content/renderer/websharedworker_proxy.h" |
50 #include "net/base/net_errors.h" | 52 #include "net/base/net_errors.h" |
51 #include "net/http/http_util.h" | 53 #include "net/http/http_util.h" |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1180 // Check whether we have new encoding name. | 1182 // Check whether we have new encoding name. |
1181 render_view_->UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); | 1183 render_view_->UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); |
1182 } | 1184 } |
1183 | 1185 |
1184 void RenderFrameImpl::didClearWindowObject(blink::WebFrame* frame, | 1186 void RenderFrameImpl::didClearWindowObject(blink::WebFrame* frame, |
1185 int world_id) { | 1187 int world_id) { |
1186 // TODO(nasko): Move implementation here. Needed state: | 1188 // TODO(nasko): Move implementation here. Needed state: |
1187 // * enabled_bindings_ | 1189 // * enabled_bindings_ |
1188 // * dom_automation_controller_ | 1190 // * dom_automation_controller_ |
1189 // * stats_collection_controller_ | 1191 // * stats_collection_controller_ |
1192 | |
1190 render_view_->didClearWindowObject(frame, world_id); | 1193 render_view_->didClearWindowObject(frame, world_id); |
1194 | |
1195 // Only install controllers into the main world. | |
1196 if (world_id) | |
1197 return; | |
1198 | |
1199 if (render_view_->GetEnabledBindings() & BINDINGS_POLICY_DOM_AUTOMATION) { | |
Charlie Reis
2014/02/15 01:47:33
nit: No braces.
mkosiba (inactive)
2014/02/17 17:42:31
Done.
| |
1200 DomAutomationController::Install(this, frame); | |
1201 } | |
1191 } | 1202 } |
1192 | 1203 |
1193 void RenderFrameImpl::didCreateDocumentElement(blink::WebFrame* frame) { | 1204 void RenderFrameImpl::didCreateDocumentElement(blink::WebFrame* frame) { |
1194 // Notify the browser about non-blank documents loading in the top frame. | 1205 // Notify the browser about non-blank documents loading in the top frame. |
1195 GURL url = frame->document().url(); | 1206 GURL url = frame->document().url(); |
1196 if (url.is_valid() && url.spec() != kAboutBlankURL) { | 1207 if (url.is_valid() && url.spec() != kAboutBlankURL) { |
1197 // TODO(nasko): Check if webview()->mainFrame() is the same as the | 1208 // TODO(nasko): Check if webview()->mainFrame() is the same as the |
1198 // frame->tree()->top(). | 1209 // frame->tree()->top(). |
1199 if (frame == render_view_->webview()->mainFrame()) { | 1210 if (frame == render_view_->webview()->mainFrame()) { |
1200 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( | 1211 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1954 | 1965 |
1955 void RenderFrameImpl::didStartLoading() { | 1966 void RenderFrameImpl::didStartLoading() { |
1956 Send(new FrameHostMsg_DidStartLoading(routing_id_)); | 1967 Send(new FrameHostMsg_DidStartLoading(routing_id_)); |
1957 } | 1968 } |
1958 | 1969 |
1959 void RenderFrameImpl::didStopLoading() { | 1970 void RenderFrameImpl::didStopLoading() { |
1960 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | 1971 Send(new FrameHostMsg_DidStopLoading(routing_id_)); |
1961 } | 1972 } |
1962 | 1973 |
1963 } // namespace content | 1974 } // namespace content |
OLD | NEW |