| 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/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 4122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4133 // TODO(clamy): see if initial commits in subframes should be handled | 4133 // TODO(clamy): see if initial commits in subframes should be handled |
| 4134 // separately. | 4134 // separately. |
| 4135 bool replace = is_reload || is_history_navigation || | 4135 bool replace = is_reload || is_history_navigation || |
| 4136 common_params.url == GetLoadingUrl(); | 4136 common_params.url == GetLoadingUrl(); |
| 4137 LoadNavigationErrorPage(failed_request, error, replace); | 4137 LoadNavigationErrorPage(failed_request, error, replace); |
| 4138 } | 4138 } |
| 4139 | 4139 |
| 4140 WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation( | 4140 WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation( |
| 4141 RenderFrame* render_frame, | 4141 RenderFrame* render_frame, |
| 4142 const NavigationPolicyInfo& info) { | 4142 const NavigationPolicyInfo& info) { |
| 4143 #ifdef OS_ANDROID | |
| 4144 // The handlenavigation API is deprecated and will be removed once | |
| 4145 // crbug.com/325351 is resolved. | |
| 4146 if (info.urlRequest.url() != GURL(kSwappedOutURL) && | |
| 4147 GetContentClient()->renderer()->HandleNavigation( | |
| 4148 render_frame, | |
| 4149 static_cast<DocumentState*>(info.extraData), | |
| 4150 render_view_->opener_id_, | |
| 4151 info.frame, | |
| 4152 info.urlRequest, | |
| 4153 info.navigationType, | |
| 4154 info.defaultPolicy, | |
| 4155 info.isRedirect)) { | |
| 4156 return blink::WebNavigationPolicyIgnore; | |
| 4157 } | |
| 4158 #endif | |
| 4159 | |
| 4160 Referrer referrer(RenderViewImpl::GetReferrerFromRequest(info.frame, | 4143 Referrer referrer(RenderViewImpl::GetReferrerFromRequest(info.frame, |
| 4161 info.urlRequest)); | 4144 info.urlRequest)); |
| 4162 const base::CommandLine& command_line = | 4145 const base::CommandLine& command_line = |
| 4163 *base::CommandLine::ForCurrentProcess(); | 4146 *base::CommandLine::ForCurrentProcess(); |
| 4164 | 4147 |
| 4165 if (command_line.HasSwitch(switches::kSitePerProcess) && is_subframe_) { | 4148 if (command_line.HasSwitch(switches::kSitePerProcess) && is_subframe_) { |
| 4166 // There's no reason to ignore navigations on subframes, since the swap out | 4149 // There's no reason to ignore navigations on subframes, since the swap out |
| 4167 // logic no longer applies. | 4150 // logic no longer applies. |
| 4168 } else { | 4151 } else { |
| 4169 if (is_swapped_out_) { | 4152 if (is_swapped_out_) { |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5012 void RenderFrameImpl::RegisterMojoServices() { | 4995 void RenderFrameImpl::RegisterMojoServices() { |
| 5013 // Only main frame have ImageDownloader service. | 4996 // Only main frame have ImageDownloader service. |
| 5014 if (!frame_->parent()) { | 4997 if (!frame_->parent()) { |
| 5015 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>( | 4998 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>( |
| 5016 base::Bind(&ImageDownloaderImpl::CreateMojoService, | 4999 base::Bind(&ImageDownloaderImpl::CreateMojoService, |
| 5017 base::Unretained(this))); | 5000 base::Unretained(this))); |
| 5018 } | 5001 } |
| 5019 } | 5002 } |
| 5020 | 5003 |
| 5021 } // namespace content | 5004 } // namespace content |
| OLD | NEW |