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/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/metrics/user_metrics_action.h" | 10 #include "base/metrics/user_metrics_action.h" |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 return GetContentClient()->browser()->CanCommitURL(GetProcess(), url); | 738 return GetContentClient()->browser()->CanCommitURL(GetProcess(), url); |
739 } | 739 } |
740 | 740 |
741 void RenderFrameHostImpl::Navigate(const FrameMsg_Navigate_Params& params) { | 741 void RenderFrameHostImpl::Navigate(const FrameMsg_Navigate_Params& params) { |
742 TRACE_EVENT0("frame_host", "RenderFrameHostImpl::Navigate"); | 742 TRACE_EVENT0("frame_host", "RenderFrameHostImpl::Navigate"); |
743 // Browser plugin guests are not allowed to navigate outside web-safe schemes, | 743 // Browser plugin guests are not allowed to navigate outside web-safe schemes, |
744 // so do not grant them the ability to request additional URLs. | 744 // so do not grant them the ability to request additional URLs. |
745 if (!GetProcess()->IsGuest()) { | 745 if (!GetProcess()->IsGuest()) { |
746 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | 746 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
747 GetProcess()->GetID(), params.url); | 747 GetProcess()->GetID(), params.url); |
748 if (params.url.SchemeIs(kDataScheme) && | 748 if (params.url.SchemeIs(url::kDataScheme) && |
749 params.base_url_for_data_url.SchemeIs(kFileScheme)) { | 749 params.base_url_for_data_url.SchemeIs(url::kFileScheme)) { |
750 // If 'data:' is used, and we have a 'file:' base url, grant access to | 750 // If 'data:' is used, and we have a 'file:' base url, grant access to |
751 // local files. | 751 // local files. |
752 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | 752 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
753 GetProcess()->GetID(), params.base_url_for_data_url); | 753 GetProcess()->GetID(), params.base_url_for_data_url); |
754 } | 754 } |
755 } | 755 } |
756 | 756 |
757 // Only send the message if we aren't suspended at the start of a cross-site | 757 // Only send the message if we aren't suspended at the start of a cross-site |
758 // request. | 758 // request. |
759 if (render_view_host_->navigations_suspended_) { | 759 if (render_view_host_->navigations_suspended_) { |
(...skipping 16 matching lines...) Expand all Loading... |
776 // loading" message will be received asynchronously from the UI of the | 776 // loading" message will be received asynchronously from the UI of the |
777 // browser. But we want to keep the throbber in sync with what's happening | 777 // browser. But we want to keep the throbber in sync with what's happening |
778 // in the UI. For example, we want to start throbbing immediately when the | 778 // in the UI. For example, we want to start throbbing immediately when the |
779 // user naivgates even if the renderer is delayed. There is also an issue | 779 // user naivgates even if the renderer is delayed. There is also an issue |
780 // with the throbber starting because the WebUI (which controls whether the | 780 // with the throbber starting because the WebUI (which controls whether the |
781 // favicon is displayed) happens synchronously. If the start loading | 781 // favicon is displayed) happens synchronously. If the start loading |
782 // messages was asynchronous, then the default favicon would flash in. | 782 // messages was asynchronous, then the default favicon would flash in. |
783 // | 783 // |
784 // Blink doesn't send throb notifications for JavaScript URLs, so we | 784 // Blink doesn't send throb notifications for JavaScript URLs, so we |
785 // don't want to either. | 785 // don't want to either. |
786 if (!params.url.SchemeIs(kJavaScriptScheme)) | 786 if (!params.url.SchemeIs(url::kJavaScriptScheme)) |
787 delegate_->DidStartLoading(this, true); | 787 delegate_->DidStartLoading(this, true); |
788 } | 788 } |
789 | 789 |
790 void RenderFrameHostImpl::NavigateToURL(const GURL& url) { | 790 void RenderFrameHostImpl::NavigateToURL(const GURL& url) { |
791 FrameMsg_Navigate_Params params; | 791 FrameMsg_Navigate_Params params; |
792 params.page_id = -1; | 792 params.page_id = -1; |
793 params.pending_history_list_offset = -1; | 793 params.pending_history_list_offset = -1; |
794 params.current_history_list_offset = -1; | 794 params.current_history_list_offset = -1; |
795 params.current_history_list_length = 0; | 795 params.current_history_list_length = 0; |
796 params.url = url; | 796 params.url = url; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 cancel_notification_callbacks_.erase(notification_id); | 885 cancel_notification_callbacks_.erase(notification_id); |
886 } | 886 } |
887 | 887 |
888 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( | 888 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( |
889 int callback_context) { | 889 int callback_context) { |
890 Send(new DesktopNotificationMsg_PermissionRequestDone( | 890 Send(new DesktopNotificationMsg_PermissionRequestDone( |
891 routing_id_, callback_context)); | 891 routing_id_, callback_context)); |
892 } | 892 } |
893 | 893 |
894 } // namespace content | 894 } // namespace content |
OLD | NEW |