OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 // chrome://settings. | 1370 // chrome://settings. |
1371 bool scheme_is_blocked = | 1371 bool scheme_is_blocked = |
1372 (!ChildProcessSecurityPolicyImpl::GetInstance()->IsWebSafeScheme( | 1372 (!ChildProcessSecurityPolicyImpl::GetInstance()->IsWebSafeScheme( |
1373 url.scheme()) && | 1373 url.scheme()) && |
1374 !ChildProcessSecurityPolicyImpl::GetInstance()->IsPseudoScheme( | 1374 !ChildProcessSecurityPolicyImpl::GetInstance()->IsPseudoScheme( |
1375 url.scheme())) || | 1375 url.scheme())) || |
1376 url.SchemeIs(kJavaScriptScheme); | 1376 url.SchemeIs(kJavaScriptScheme); |
1377 if (scheme_is_blocked || !url.is_valid()) { | 1377 if (scheme_is_blocked || !url.is_valid()) { |
1378 if (delegate_) { | 1378 if (delegate_) { |
1379 std::string error_type; | 1379 std::string error_type; |
1380 RemoveChars(net::ErrorToString(net::ERR_ABORTED), "net::", &error_type); | 1380 base::RemoveChars(net::ErrorToString(net::ERR_ABORTED), "net::", |
| 1381 &error_type); |
1381 delegate_->LoadAbort(true /* is_top_level */, url, error_type); | 1382 delegate_->LoadAbort(true /* is_top_level */, url, error_type); |
1382 } | 1383 } |
1383 return; | 1384 return; |
1384 } | 1385 } |
1385 | 1386 |
1386 GURL validated_url(url); | 1387 GURL validated_url(url); |
1387 RenderViewHost::FilterURL( | 1388 RenderViewHost::FilterURL( |
1388 GetWebContents()->GetRenderProcessHost(), | 1389 GetWebContents()->GetRenderProcessHost(), |
1389 false, | 1390 false, |
1390 &validated_url); | 1391 &validated_url); |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1758 request_info.Set(browser_plugin::kRequestMethod, | 1759 request_info.Set(browser_plugin::kRequestMethod, |
1759 base::Value::CreateStringValue(request_method)); | 1760 base::Value::CreateStringValue(request_method)); |
1760 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); | 1761 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); |
1761 | 1762 |
1762 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, | 1763 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, |
1763 new DownloadRequest(callback), | 1764 new DownloadRequest(callback), |
1764 request_info); | 1765 request_info); |
1765 } | 1766 } |
1766 | 1767 |
1767 } // namespace content | 1768 } // namespace content |
OLD | NEW |