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/browser/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
11 #include "content/browser/frame_host/navigation_before_commit_info.h" | |
12 #include "content/browser/frame_host/navigation_controller_impl.h" | 11 #include "content/browser/frame_host/navigation_controller_impl.h" |
13 #include "content/browser/frame_host/navigation_entry_impl.h" | 12 #include "content/browser/frame_host/navigation_entry_impl.h" |
14 #include "content/browser/frame_host/navigator_delegate.h" | 13 #include "content/browser/frame_host/navigator_delegate.h" |
15 #include "content/browser/frame_host/render_frame_host_impl.h" | 14 #include "content/browser/frame_host/render_frame_host_impl.h" |
16 #include "content/browser/renderer_host/render_view_host_impl.h" | 15 #include "content/browser/renderer_host/render_view_host_impl.h" |
17 #include "content/browser/site_instance_impl.h" | 16 #include "content/browser/site_instance_impl.h" |
18 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 17 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
19 #include "content/browser/webui/web_ui_impl.h" | 18 #include "content/browser/webui/web_ui_impl.h" |
20 #include "content/common/frame_messages.h" | 19 #include "content/common/frame_messages.h" |
21 #include "content/common/view_messages.h" | 20 #include "content/common/view_messages.h" |
22 #include "content/public/browser/browser_context.h" | 21 #include "content/public/browser/browser_context.h" |
23 #include "content/public/browser/content_browser_client.h" | 22 #include "content/public/browser/content_browser_client.h" |
24 #include "content/public/browser/global_request_id.h" | 23 #include "content/public/browser/global_request_id.h" |
25 #include "content/public/browser/invalidate_type.h" | 24 #include "content/public/browser/invalidate_type.h" |
26 #include "content/public/browser/navigation_controller.h" | 25 #include "content/public/browser/navigation_controller.h" |
27 #include "content/public/browser/navigation_details.h" | 26 #include "content/public/browser/navigation_details.h" |
28 #include "content/public/browser/page_navigator.h" | 27 #include "content/public/browser/page_navigator.h" |
29 #include "content/public/browser/render_view_host.h" | 28 #include "content/public/browser/render_view_host.h" |
| 29 #include "content/public/browser/stream_handle.h" |
30 #include "content/public/common/bindings_policy.h" | 30 #include "content/public/common/bindings_policy.h" |
31 #include "content/public/common/content_client.h" | 31 #include "content/public/common/content_client.h" |
32 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
33 #include "content/public/common/url_constants.h" | 33 #include "content/public/common/url_constants.h" |
34 #include "content/public/common/url_utils.h" | 34 #include "content/public/common/url_utils.h" |
35 | 35 |
36 namespace content { | 36 namespace content { |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 params.referrer = Referrer(); | 656 params.referrer = Referrer(); |
657 | 657 |
658 // Navigations in Web UI pages count as browser-initiated navigations. | 658 // Navigations in Web UI pages count as browser-initiated navigations. |
659 params.is_renderer_initiated = false; | 659 params.is_renderer_initiated = false; |
660 } | 660 } |
661 | 661 |
662 if (delegate_) | 662 if (delegate_) |
663 delegate_->RequestOpenURL(render_frame_host, params); | 663 delegate_->RequestOpenURL(render_frame_host, params); |
664 } | 664 } |
665 | 665 |
666 void NavigatorImpl::CommitNavigation( | 666 void NavigatorImpl::CommitNavigation(RenderFrameHostImpl* render_frame_host, |
667 RenderFrameHostImpl* render_frame_host, | 667 const GURL& url, |
668 const NavigationBeforeCommitInfo& info) { | 668 ResourceResponse* response, |
669 CheckWebUIRendererDoesNotDisplayNormalURL( | 669 scoped_ptr<StreamHandle> body) { |
670 render_frame_host, info.navigation_url); | 670 CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host, url); |
671 // TODO(clamy): the render_frame_host should now send a commit IPC to the | 671 // TODO(clamy): the render_frame_host should now send a commit IPC to the |
672 // renderer. | 672 // renderer. |
| 673 NOTIMPLEMENTED(); |
673 } | 674 } |
674 | 675 |
675 void NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL( | 676 void NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL( |
676 RenderFrameHostImpl* render_frame_host, | 677 RenderFrameHostImpl* render_frame_host, |
677 const GURL& url) { | 678 const GURL& url) { |
678 int enabled_bindings = | 679 int enabled_bindings = |
679 render_frame_host->render_view_host()->GetEnabledBindings(); | 680 render_frame_host->render_view_host()->GetEnabledBindings(); |
680 bool is_allowed_in_web_ui_renderer = | 681 bool is_allowed_in_web_ui_renderer = |
681 WebUIControllerFactoryRegistry::GetInstance()->IsURLAcceptableForWebUI( | 682 WebUIControllerFactoryRegistry::GetInstance()->IsURLAcceptableForWebUI( |
682 controller_->GetBrowserContext(), url); | 683 controller_->GetBrowserContext(), url); |
683 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && | 684 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && |
684 !is_allowed_in_web_ui_renderer) { | 685 !is_allowed_in_web_ui_renderer) { |
685 // Log the URL to help us diagnose any future failures of this CHECK. | 686 // Log the URL to help us diagnose any future failures of this CHECK. |
686 GetContentClient()->SetActiveURL(url); | 687 GetContentClient()->SetActiveURL(url); |
687 CHECK(0); | 688 CHECK(0); |
688 } | 689 } |
689 } | 690 } |
690 | 691 |
691 } // namespace content | 692 } // namespace content |
OLD | NEW |