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/process/kill.h" | 15 #include "base/process/kill.h" |
16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "content/child/appcache/appcache_dispatcher.h" | 19 #include "content/child/appcache/appcache_dispatcher.h" |
20 #include "content/child/plugin_messages.h" | 20 #include "content/child/plugin_messages.h" |
21 #include "content/child/quota_dispatcher.h" | 21 #include "content/child/quota_dispatcher.h" |
22 #include "content/child/request_extra_data.h" | 22 #include "content/child/request_extra_data.h" |
23 #include "content/child/service_worker/web_service_worker_provider_impl.h" | 23 #include "content/child/service_worker/web_service_worker_provider_impl.h" |
24 #include "content/common/frame_messages.h" | 24 #include "content/common/frame_messages.h" |
25 #include "content/common/socket_stream_handle_data.h" | 25 #include "content/common/socket_stream_handle_data.h" |
26 #include "content/common/swapped_out_messages.h" | 26 #include "content/common/swapped_out_messages.h" |
27 #include "content/common/view_messages.h" | 27 #include "content/common/view_messages.h" |
| 28 #include "content/public/common/bindings_policy.h" |
28 #include "content/public/common/content_constants.h" | 29 #include "content/public/common/content_constants.h" |
29 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
30 #include "content/public/common/context_menu_params.h" | 31 #include "content/public/common/context_menu_params.h" |
31 #include "content/public/common/url_constants.h" | 32 #include "content/public/common/url_constants.h" |
32 #include "content/public/common/url_utils.h" | 33 #include "content/public/common/url_utils.h" |
33 #include "content/public/renderer/content_renderer_client.h" | 34 #include "content/public/renderer/content_renderer_client.h" |
34 #include "content/public/renderer/context_menu_client.h" | 35 #include "content/public/renderer/context_menu_client.h" |
35 #include "content/public/renderer/document_state.h" | 36 #include "content/public/renderer/document_state.h" |
36 #include "content/public/renderer/history_item_serialization.h" | 37 #include "content/public/renderer/history_item_serialization.h" |
37 #include "content/public/renderer/navigation_state.h" | 38 #include "content/public/renderer/navigation_state.h" |
38 #include "content/public/renderer/render_frame_observer.h" | 39 #include "content/public/renderer/render_frame_observer.h" |
39 #include "content/renderer/accessibility/renderer_accessibility.h" | 40 #include "content/renderer/accessibility/renderer_accessibility.h" |
40 #include "content/renderer/browser_plugin/browser_plugin.h" | 41 #include "content/renderer/browser_plugin/browser_plugin.h" |
41 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 42 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
42 #include "content/renderer/child_frame_compositing_helper.h" | 43 #include "content/renderer/child_frame_compositing_helper.h" |
43 #include "content/renderer/context_menu_params_builder.h" | 44 #include "content/renderer/context_menu_params_builder.h" |
| 45 #include "content/renderer/dom_automation_controller.h" |
44 #include "content/renderer/internal_document_state_data.h" | 46 #include "content/renderer/internal_document_state_data.h" |
45 #include "content/renderer/npapi/plugin_channel_host.h" | 47 #include "content/renderer/npapi/plugin_channel_host.h" |
46 #include "content/renderer/render_thread_impl.h" | 48 #include "content/renderer/render_thread_impl.h" |
47 #include "content/renderer/render_view_impl.h" | 49 #include "content/renderer/render_view_impl.h" |
48 #include "content/renderer/render_widget_fullscreen_pepper.h" | 50 #include "content/renderer/render_widget_fullscreen_pepper.h" |
49 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 51 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
50 #include "content/renderer/shared_worker_repository.h" | 52 #include "content/renderer/shared_worker_repository.h" |
51 #include "content/renderer/websharedworker_proxy.h" | 53 #include "content/renderer/websharedworker_proxy.h" |
52 #include "net/base/data_url.h" | 54 #include "net/base/data_url.h" |
53 #include "net/base/net_errors.h" | 55 #include "net/base/net_errors.h" |
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 // Check whether we have new encoding name. | 1432 // Check whether we have new encoding name. |
1431 render_view_->UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); | 1433 render_view_->UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); |
1432 } | 1434 } |
1433 | 1435 |
1434 void RenderFrameImpl::didClearWindowObject(blink::WebFrame* frame, | 1436 void RenderFrameImpl::didClearWindowObject(blink::WebFrame* frame, |
1435 int world_id) { | 1437 int world_id) { |
1436 // TODO(nasko): Move implementation here. Needed state: | 1438 // TODO(nasko): Move implementation here. Needed state: |
1437 // * enabled_bindings_ | 1439 // * enabled_bindings_ |
1438 // * dom_automation_controller_ | 1440 // * dom_automation_controller_ |
1439 // * stats_collection_controller_ | 1441 // * stats_collection_controller_ |
| 1442 |
1440 render_view_->didClearWindowObject(frame, world_id); | 1443 render_view_->didClearWindowObject(frame, world_id); |
| 1444 |
| 1445 // Only install controllers into the main world. |
| 1446 if (world_id) |
| 1447 return; |
| 1448 |
| 1449 if (render_view_->GetEnabledBindings() & BINDINGS_POLICY_DOM_AUTOMATION) |
| 1450 DomAutomationController::Install(this, frame); |
1441 } | 1451 } |
1442 | 1452 |
1443 void RenderFrameImpl::didCreateDocumentElement(blink::WebFrame* frame) { | 1453 void RenderFrameImpl::didCreateDocumentElement(blink::WebFrame* frame) { |
1444 // Notify the browser about non-blank documents loading in the top frame. | 1454 // Notify the browser about non-blank documents loading in the top frame. |
1445 GURL url = frame->document().url(); | 1455 GURL url = frame->document().url(); |
1446 if (url.is_valid() && url.spec() != kAboutBlankURL) { | 1456 if (url.is_valid() && url.spec() != kAboutBlankURL) { |
1447 // TODO(nasko): Check if webview()->mainFrame() is the same as the | 1457 // TODO(nasko): Check if webview()->mainFrame() is the same as the |
1448 // frame->tree()->top(). | 1458 // frame->tree()->top(). |
1449 if (frame == render_view_->webview()->mainFrame()) { | 1459 if (frame == render_view_->webview()->mainFrame()) { |
1450 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( | 1460 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 | 2214 |
2205 void RenderFrameImpl::didStartLoading() { | 2215 void RenderFrameImpl::didStartLoading() { |
2206 Send(new FrameHostMsg_DidStartLoading(routing_id_)); | 2216 Send(new FrameHostMsg_DidStartLoading(routing_id_)); |
2207 } | 2217 } |
2208 | 2218 |
2209 void RenderFrameImpl::didStopLoading() { | 2219 void RenderFrameImpl::didStopLoading() { |
2210 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | 2220 Send(new FrameHostMsg_DidStopLoading(routing_id_)); |
2211 } | 2221 } |
2212 | 2222 |
2213 } // namespace content | 2223 } // namespace content |
OLD | NEW |