Chromium Code Reviews| 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 3936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3947 GURL base(base_url); | 3947 GURL base(base_url); |
| 3948 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); | 3948 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); |
| 3949 if (base.GetOrigin() != absolute_url.GetOrigin()) | 3949 if (base.GetOrigin() != absolute_url.GetOrigin()) |
| 3950 return; | 3950 return; |
| 3951 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, | 3951 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, |
| 3952 base::UTF16ToUTF8(scheme), | 3952 base::UTF16ToUTF8(scheme), |
| 3953 absolute_url, | 3953 absolute_url, |
| 3954 user_gesture)); | 3954 user_gesture)); |
| 3955 } | 3955 } |
| 3956 | 3956 |
| 3957 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, | |
|
jamesr
2014/08/22 05:34:36
annotate with a comment or something that the regi
| |
| 3958 const WebURL& url, | |
| 3959 const WebString& title) { | |
| 3960 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); | |
| 3961 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, | |
| 3962 base::UTF16ToUTF8(scheme), | |
| 3963 url, | |
| 3964 title, | |
| 3965 user_gesture)); | |
| 3966 } | |
| 3967 | |
| 3968 void RenderViewImpl::unregisterProtocolHandler(const WebString& scheme, | |
| 3969 const WebURL& url) { | |
| 3970 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); | |
| 3971 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, | |
| 3972 base::UTF16ToUTF8(scheme), | |
| 3973 url, | |
| 3974 user_gesture)); | |
| 3975 } | |
| 3976 | |
| 3957 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { | 3977 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { |
| 3958 blink::WebPageVisibilityState current_state = is_hidden() ? | 3978 blink::WebPageVisibilityState current_state = is_hidden() ? |
| 3959 blink::WebPageVisibilityStateHidden : | 3979 blink::WebPageVisibilityStateHidden : |
| 3960 blink::WebPageVisibilityStateVisible; | 3980 blink::WebPageVisibilityStateVisible; |
| 3961 blink::WebPageVisibilityState override_state = current_state; | 3981 blink::WebPageVisibilityState override_state = current_state; |
| 3962 // TODO(jam): move this method to WebFrameClient. | 3982 // TODO(jam): move this method to WebFrameClient. |
| 3963 if (GetContentClient()->renderer()-> | 3983 if (GetContentClient()->renderer()-> |
| 3964 ShouldOverridePageVisibilityState(main_render_frame_.get(), | 3984 ShouldOverridePageVisibilityState(main_render_frame_.get(), |
| 3965 &override_state)) | 3985 &override_state)) |
| 3966 return override_state; | 3986 return override_state; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4275 std::vector<gfx::Size> sizes; | 4295 std::vector<gfx::Size> sizes; |
| 4276 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4296 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4277 if (!url.isEmpty()) | 4297 if (!url.isEmpty()) |
| 4278 urls.push_back( | 4298 urls.push_back( |
| 4279 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4299 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4280 } | 4300 } |
| 4281 SendUpdateFaviconURL(urls); | 4301 SendUpdateFaviconURL(urls); |
| 4282 } | 4302 } |
| 4283 | 4303 |
| 4284 } // namespace content | 4304 } // namespace content |
| OLD | NEW |