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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 return GetContentClient()->browser()->CanCommitURL(GetProcess(), url); | 708 return GetContentClient()->browser()->CanCommitURL(GetProcess(), url); |
709 } | 709 } |
710 | 710 |
711 void RenderFrameHostImpl::Navigate(const FrameMsg_Navigate_Params& params) { | 711 void RenderFrameHostImpl::Navigate(const FrameMsg_Navigate_Params& params) { |
712 TRACE_EVENT0("frame_host", "RenderFrameHostImpl::Navigate"); | 712 TRACE_EVENT0("frame_host", "RenderFrameHostImpl::Navigate"); |
713 // Browser plugin guests are not allowed to navigate outside web-safe schemes, | 713 // Browser plugin guests are not allowed to navigate outside web-safe schemes, |
714 // so do not grant them the ability to request additional URLs. | 714 // so do not grant them the ability to request additional URLs. |
715 if (!GetProcess()->IsGuest()) { | 715 if (!GetProcess()->IsGuest()) { |
716 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | 716 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
717 GetProcess()->GetID(), params.url); | 717 GetProcess()->GetID(), params.url); |
718 if (params.url.SchemeIs(kDataScheme) && | 718 if (params.url.SchemeIs(url::kDataScheme) && |
719 params.base_url_for_data_url.SchemeIs(kFileScheme)) { | 719 params.base_url_for_data_url.SchemeIs(url::kFileScheme)) { |
720 // If 'data:' is used, and we have a 'file:' base url, grant access to | 720 // If 'data:' is used, and we have a 'file:' base url, grant access to |
721 // local files. | 721 // local files. |
722 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | 722 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
723 GetProcess()->GetID(), params.base_url_for_data_url); | 723 GetProcess()->GetID(), params.base_url_for_data_url); |
724 } | 724 } |
725 } | 725 } |
726 | 726 |
727 // Only send the message if we aren't suspended at the start of a cross-site | 727 // Only send the message if we aren't suspended at the start of a cross-site |
728 // request. | 728 // request. |
729 if (render_view_host_->navigations_suspended_) { | 729 if (render_view_host_->navigations_suspended_) { |
(...skipping 16 matching lines...) Expand all Loading... |
746 // loading" message will be received asynchronously from the UI of the | 746 // loading" message will be received asynchronously from the UI of the |
747 // browser. But we want to keep the throbber in sync with what's happening | 747 // browser. But we want to keep the throbber in sync with what's happening |
748 // in the UI. For example, we want to start throbbing immediately when the | 748 // in the UI. For example, we want to start throbbing immediately when the |
749 // user naivgates even if the renderer is delayed. There is also an issue | 749 // user naivgates even if the renderer is delayed. There is also an issue |
750 // with the throbber starting because the WebUI (which controls whether the | 750 // with the throbber starting because the WebUI (which controls whether the |
751 // favicon is displayed) happens synchronously. If the start loading | 751 // favicon is displayed) happens synchronously. If the start loading |
752 // messages was asynchronous, then the default favicon would flash in. | 752 // messages was asynchronous, then the default favicon would flash in. |
753 // | 753 // |
754 // Blink doesn't send throb notifications for JavaScript URLs, so we | 754 // Blink doesn't send throb notifications for JavaScript URLs, so we |
755 // don't want to either. | 755 // don't want to either. |
756 if (!params.url.SchemeIs(kJavaScriptScheme)) | 756 if (!params.url.SchemeIs(url::kJavaScriptScheme)) |
757 delegate_->DidStartLoading(this, true); | 757 delegate_->DidStartLoading(this, true); |
758 } | 758 } |
759 | 759 |
760 void RenderFrameHostImpl::NavigateToURL(const GURL& url) { | 760 void RenderFrameHostImpl::NavigateToURL(const GURL& url) { |
761 FrameMsg_Navigate_Params params; | 761 FrameMsg_Navigate_Params params; |
762 params.page_id = -1; | 762 params.page_id = -1; |
763 params.pending_history_list_offset = -1; | 763 params.pending_history_list_offset = -1; |
764 params.current_history_list_offset = -1; | 764 params.current_history_list_offset = -1; |
765 params.current_history_list_length = 0; | 765 params.current_history_list_length = 0; |
766 params.url = url; | 766 params.url = url; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 cancel_notification_callbacks_.erase(notification_id); | 855 cancel_notification_callbacks_.erase(notification_id); |
856 } | 856 } |
857 | 857 |
858 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( | 858 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( |
859 int callback_context) { | 859 int callback_context) { |
860 Send(new DesktopNotificationMsg_PermissionRequestDone( | 860 Send(new DesktopNotificationMsg_PermissionRequestDone( |
861 routing_id_, callback_context)); | 861 routing_id_, callback_context)); |
862 } | 862 } |
863 | 863 |
864 } // namespace content | 864 } // namespace content |
OLD | NEW |