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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2858 if (policy == WebKit::WebNavigationPolicyDownload) { | 2858 if (policy == WebKit::WebNavigationPolicyDownload) { |
2859 Send(new ViewHostMsg_DownloadUrl(routing_id_, request.url(), referrer, | 2859 Send(new ViewHostMsg_DownloadUrl(routing_id_, request.url(), referrer, |
2860 suggested_name)); | 2860 suggested_name)); |
2861 } else { | 2861 } else { |
2862 OpenURL(frame, request.url(), referrer, policy); | 2862 OpenURL(frame, request.url(), referrer, policy); |
2863 } | 2863 } |
2864 } | 2864 } |
2865 | 2865 |
2866 WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( | 2866 WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( |
2867 WebFrame* frame, const WebURLRequest& request, WebNavigationType type, | 2867 WebFrame* frame, const WebURLRequest& request, WebNavigationType type, |
2868 const WebNode&, WebNavigationPolicy default_policy, bool is_redirect) { | 2868 WebNavigationPolicy default_policy, bool is_redirect) { |
2869 if (request.url() != GURL(kSwappedOutURL) && | 2869 if (request.url() != GURL(kSwappedOutURL) && |
2870 GetContentClient()->renderer()->HandleNavigation(frame, request, type, | 2870 GetContentClient()->renderer()->HandleNavigation(frame, request, type, |
2871 default_policy, | 2871 default_policy, |
2872 is_redirect)) { | 2872 is_redirect)) { |
2873 return WebKit::WebNavigationPolicyIgnore; | 2873 return WebKit::WebNavigationPolicyIgnore; |
2874 } | 2874 } |
2875 | 2875 |
2876 Referrer referrer( | 2876 Referrer referrer( |
2877 GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))), | 2877 GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))), |
2878 GetReferrerPolicyFromRequest(frame, request)); | 2878 GetReferrerPolicyFromRequest(frame, request)); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3053 | 3053 |
3054 if (is_fork) { | 3054 if (is_fork) { |
3055 // Open the URL via the browser, not via WebKit. | 3055 // Open the URL via the browser, not via WebKit. |
3056 OpenURL(frame, url, Referrer(), default_policy); | 3056 OpenURL(frame, url, Referrer(), default_policy); |
3057 return WebKit::WebNavigationPolicyIgnore; | 3057 return WebKit::WebNavigationPolicyIgnore; |
3058 } | 3058 } |
3059 | 3059 |
3060 return default_policy; | 3060 return default_policy; |
3061 } | 3061 } |
3062 | 3062 |
| 3063 WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( |
| 3064 WebFrame* frame, const WebURLRequest& request, WebNavigationType type, |
| 3065 const WebNode&, WebNavigationPolicy default_policy, bool is_redirect) { |
| 3066 return decidePolicyForNavigation(frame, request, type, |
| 3067 default_policy, is_redirect); |
| 3068 } |
| 3069 |
3063 bool RenderViewImpl::canHandleRequest( | 3070 bool RenderViewImpl::canHandleRequest( |
3064 WebFrame* frame, const WebURLRequest& request) { | 3071 WebFrame* frame, const WebURLRequest& request) { |
3065 // We allow WebKit to think that everything can be handled even though | 3072 // We allow WebKit to think that everything can be handled even though |
3066 // browser-side we limit what we load. | 3073 // browser-side we limit what we load. |
3067 return true; | 3074 return true; |
3068 } | 3075 } |
3069 | 3076 |
3070 WebURLError RenderViewImpl::cannotHandleRequestError( | 3077 WebURLError RenderViewImpl::cannotHandleRequestError( |
3071 WebFrame* frame, const WebURLRequest& request) { | 3078 WebFrame* frame, const WebURLRequest& request) { |
3072 NOTREACHED(); // Since we said we can handle all requests. | 3079 NOTREACHED(); // Since we said we can handle all requests. |
(...skipping 3544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6617 WebURL url = icon_urls[i].iconURL(); | 6624 WebURL url = icon_urls[i].iconURL(); |
6618 if (!url.isEmpty()) | 6625 if (!url.isEmpty()) |
6619 urls.push_back(FaviconURL(url, | 6626 urls.push_back(FaviconURL(url, |
6620 ToFaviconType(icon_urls[i].iconType()))); | 6627 ToFaviconType(icon_urls[i].iconType()))); |
6621 } | 6628 } |
6622 SendUpdateFaviconURL(urls); | 6629 SendUpdateFaviconURL(urls); |
6623 } | 6630 } |
6624 | 6631 |
6625 | 6632 |
6626 } // namespace content | 6633 } // namespace content |
OLD | NEW |