| 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 3890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3901 } | 3901 } |
| 3902 | 3902 |
| 3903 double RenderViewImpl::zoomLevelToZoomFactor(double zoom_level) const { | 3903 double RenderViewImpl::zoomLevelToZoomFactor(double zoom_level) const { |
| 3904 return ZoomLevelToZoomFactor(zoom_level); | 3904 return ZoomLevelToZoomFactor(zoom_level); |
| 3905 } | 3905 } |
| 3906 | 3906 |
| 3907 double RenderViewImpl::zoomFactorToZoomLevel(double factor) const { | 3907 double RenderViewImpl::zoomFactorToZoomLevel(double factor) const { |
| 3908 return ZoomFactorToZoomLevel(factor); | 3908 return ZoomFactorToZoomLevel(factor); |
| 3909 } | 3909 } |
| 3910 | 3910 |
| 3911 // TODO(sanjoy.pal): Remove once blink patch lands. http://crbug.com/406236. | |
| 3912 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, | |
| 3913 const WebURL& base_url, | |
| 3914 const WebURL& url, | |
| 3915 const WebString& title) { | |
| 3916 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); | |
| 3917 GURL base(base_url); | |
| 3918 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); | |
| 3919 if (base.GetOrigin() != absolute_url.GetOrigin()) { | |
| 3920 return; | |
| 3921 } | |
| 3922 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, | |
| 3923 base::UTF16ToUTF8(scheme), | |
| 3924 absolute_url, | |
| 3925 title, | |
| 3926 user_gesture)); | |
| 3927 } | |
| 3928 | |
| 3929 void RenderViewImpl::unregisterProtocolHandler(const WebString& scheme, | |
| 3930 const WebURL& base_url, | |
| 3931 const WebURL& url) { | |
| 3932 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); | |
| 3933 GURL base(base_url); | |
| 3934 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); | |
| 3935 if (base.GetOrigin() != absolute_url.GetOrigin()) | |
| 3936 return; | |
| 3937 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, | |
| 3938 base::UTF16ToUTF8(scheme), | |
| 3939 absolute_url, | |
| 3940 user_gesture)); | |
| 3941 } | |
| 3942 | |
| 3943 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, | 3911 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, |
| 3944 const WebURL& url, | 3912 const WebURL& url, |
| 3945 const WebString& title) { | 3913 const WebString& title) { |
| 3946 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); | 3914 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); |
| 3947 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, | 3915 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, |
| 3948 base::UTF16ToUTF8(scheme), | 3916 base::UTF16ToUTF8(scheme), |
| 3949 url, | 3917 url, |
| 3950 title, | 3918 title, |
| 3951 user_gesture)); | 3919 user_gesture)); |
| 3952 } | 3920 } |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4281 std::vector<gfx::Size> sizes; | 4249 std::vector<gfx::Size> sizes; |
| 4282 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4250 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4283 if (!url.isEmpty()) | 4251 if (!url.isEmpty()) |
| 4284 urls.push_back( | 4252 urls.push_back( |
| 4285 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4253 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4286 } | 4254 } |
| 4287 SendUpdateFaviconURL(urls); | 4255 SendUpdateFaviconURL(urls); |
| 4288 } | 4256 } |
| 4289 | 4257 |
| 4290 } // namespace content | 4258 } // namespace content |
| OLD | NEW |