| 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 3475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3486 } | 3486 } |
| 3487 | 3487 |
| 3488 double RenderViewImpl::zoomLevelToZoomFactor(double zoom_level) const { | 3488 double RenderViewImpl::zoomLevelToZoomFactor(double zoom_level) const { |
| 3489 return ZoomLevelToZoomFactor(zoom_level); | 3489 return ZoomLevelToZoomFactor(zoom_level); |
| 3490 } | 3490 } |
| 3491 | 3491 |
| 3492 double RenderViewImpl::zoomFactorToZoomLevel(double factor) const { | 3492 double RenderViewImpl::zoomFactorToZoomLevel(double factor) const { |
| 3493 return ZoomFactorToZoomLevel(factor); | 3493 return ZoomFactorToZoomLevel(factor); |
| 3494 } | 3494 } |
| 3495 | 3495 |
| 3496 void RenderViewImpl::registerProtocolHandler(const WebString& scheme, | |
| 3497 const WebURL& url, | |
| 3498 const WebString& title) { | |
| 3499 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); | |
| 3500 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, | |
| 3501 base::UTF16ToUTF8(scheme), | |
| 3502 url, | |
| 3503 title, | |
| 3504 user_gesture)); | |
| 3505 } | |
| 3506 | |
| 3507 void RenderViewImpl::unregisterProtocolHandler(const WebString& scheme, | |
| 3508 const WebURL& url) { | |
| 3509 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); | |
| 3510 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, | |
| 3511 base::UTF16ToUTF8(scheme), | |
| 3512 url, | |
| 3513 user_gesture)); | |
| 3514 } | |
| 3515 | |
| 3516 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { | 3496 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { |
| 3517 blink::WebPageVisibilityState current_state = is_hidden() ? | 3497 blink::WebPageVisibilityState current_state = is_hidden() ? |
| 3518 blink::WebPageVisibilityStateHidden : | 3498 blink::WebPageVisibilityStateHidden : |
| 3519 blink::WebPageVisibilityStateVisible; | 3499 blink::WebPageVisibilityStateVisible; |
| 3520 blink::WebPageVisibilityState override_state = current_state; | 3500 blink::WebPageVisibilityState override_state = current_state; |
| 3521 // TODO(jam): move this method to WebFrameClient. | 3501 // TODO(jam): move this method to WebFrameClient. |
| 3522 if (GetContentClient()->renderer()-> | 3502 if (GetContentClient()->renderer()-> |
| 3523 ShouldOverridePageVisibilityState(main_render_frame_, | 3503 ShouldOverridePageVisibilityState(main_render_frame_, |
| 3524 &override_state)) | 3504 &override_state)) |
| 3525 return override_state; | 3505 return override_state; |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3799 std::vector<gfx::Size> sizes; | 3779 std::vector<gfx::Size> sizes; |
| 3800 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3780 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 3801 if (!url.isEmpty()) | 3781 if (!url.isEmpty()) |
| 3802 urls.push_back( | 3782 urls.push_back( |
| 3803 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3783 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 3804 } | 3784 } |
| 3805 SendUpdateFaviconURL(urls); | 3785 SendUpdateFaviconURL(urls); |
| 3806 } | 3786 } |
| 3807 | 3787 |
| 3808 } // namespace content | 3788 } // namespace content |
| OLD | NEW |