| 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 3905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3916 } | 3916 } |
| 3917 | 3917 |
| 3918 double RenderViewImpl::zoomLevelToZoomFactor(double zoom_level) const { | 3918 double RenderViewImpl::zoomLevelToZoomFactor(double zoom_level) const { |
| 3919 return ZoomLevelToZoomFactor(zoom_level); | 3919 return ZoomLevelToZoomFactor(zoom_level); |
| 3920 } | 3920 } |
| 3921 | 3921 |
| 3922 double RenderViewImpl::zoomFactorToZoomLevel(double factor) const { | 3922 double RenderViewImpl::zoomFactorToZoomLevel(double factor) const { |
| 3923 return ZoomFactorToZoomLevel(factor); | 3923 return ZoomFactorToZoomLevel(factor); |
| 3924 } | 3924 } |
| 3925 | 3925 |
| 3926 // TODO(sanjoy.pal): Remove once blink patch lands. http://crbug.com/406236. |
| 3926 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, | 3927 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, |
| 3927 const WebURL& base_url, | 3928 const WebURL& base_url, |
| 3928 const WebURL& url, | 3929 const WebURL& url, |
| 3929 const WebString& title) { | 3930 const WebString& title) { |
| 3930 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); | 3931 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); |
| 3931 GURL base(base_url); | 3932 GURL base(base_url); |
| 3932 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); | 3933 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); |
| 3933 if (base.GetOrigin() != absolute_url.GetOrigin()) { | 3934 if (base.GetOrigin() != absolute_url.GetOrigin()) { |
| 3934 return; | 3935 return; |
| 3935 } | 3936 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3947 GURL base(base_url); | 3948 GURL base(base_url); |
| 3948 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); | 3949 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); |
| 3949 if (base.GetOrigin() != absolute_url.GetOrigin()) | 3950 if (base.GetOrigin() != absolute_url.GetOrigin()) |
| 3950 return; | 3951 return; |
| 3951 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, | 3952 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, |
| 3952 base::UTF16ToUTF8(scheme), | 3953 base::UTF16ToUTF8(scheme), |
| 3953 absolute_url, | 3954 absolute_url, |
| 3954 user_gesture)); | 3955 user_gesture)); |
| 3955 } | 3956 } |
| 3956 | 3957 |
| 3958 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, |
| 3959 const WebURL& url, |
| 3960 const WebString& title) { |
| 3961 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); |
| 3962 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, |
| 3963 base::UTF16ToUTF8(scheme), |
| 3964 url, |
| 3965 title, |
| 3966 user_gesture)); |
| 3967 } |
| 3968 |
| 3969 void RenderViewImpl::unregisterProtocolHandler(const WebString& scheme, |
| 3970 const WebURL& url) { |
| 3971 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); |
| 3972 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, |
| 3973 base::UTF16ToUTF8(scheme), |
| 3974 url, |
| 3975 user_gesture)); |
| 3976 } |
| 3977 |
| 3957 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { | 3978 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { |
| 3958 blink::WebPageVisibilityState current_state = is_hidden() ? | 3979 blink::WebPageVisibilityState current_state = is_hidden() ? |
| 3959 blink::WebPageVisibilityStateHidden : | 3980 blink::WebPageVisibilityStateHidden : |
| 3960 blink::WebPageVisibilityStateVisible; | 3981 blink::WebPageVisibilityStateVisible; |
| 3961 blink::WebPageVisibilityState override_state = current_state; | 3982 blink::WebPageVisibilityState override_state = current_state; |
| 3962 // TODO(jam): move this method to WebFrameClient. | 3983 // TODO(jam): move this method to WebFrameClient. |
| 3963 if (GetContentClient()->renderer()-> | 3984 if (GetContentClient()->renderer()-> |
| 3964 ShouldOverridePageVisibilityState(main_render_frame_.get(), | 3985 ShouldOverridePageVisibilityState(main_render_frame_.get(), |
| 3965 &override_state)) | 3986 &override_state)) |
| 3966 return override_state; | 3987 return override_state; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4275 std::vector<gfx::Size> sizes; | 4296 std::vector<gfx::Size> sizes; |
| 4276 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4297 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4277 if (!url.isEmpty()) | 4298 if (!url.isEmpty()) |
| 4278 urls.push_back( | 4299 urls.push_back( |
| 4279 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4300 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4280 } | 4301 } |
| 4281 SendUpdateFaviconURL(urls); | 4302 SendUpdateFaviconURL(urls); |
| 4282 } | 4303 } |
| 4283 | 4304 |
| 4284 } // namespace content | 4305 } // namespace content |
| OLD | NEW |