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 3683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3694 if (base.GetOrigin() != absolute_url.GetOrigin()) { | 3694 if (base.GetOrigin() != absolute_url.GetOrigin()) { |
3695 return; | 3695 return; |
3696 } | 3696 } |
3697 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, | 3697 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, |
3698 base::UTF16ToUTF8(scheme), | 3698 base::UTF16ToUTF8(scheme), |
3699 absolute_url, | 3699 absolute_url, |
3700 title, | 3700 title, |
3701 user_gesture)); | 3701 user_gesture)); |
3702 } | 3702 } |
3703 | 3703 |
| 3704 void RenderViewImpl::unregisterProtocolHandler(const WebString& scheme, |
| 3705 const WebURL& base_url, |
| 3706 const WebURL& url) { |
| 3707 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); |
| 3708 GURL base(base_url); |
| 3709 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); |
| 3710 if (base.GetOrigin() != absolute_url.GetOrigin()) |
| 3711 return; |
| 3712 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, |
| 3713 base::UTF16ToUTF8(scheme), |
| 3714 absolute_url, |
| 3715 user_gesture)); |
| 3716 } |
| 3717 |
3704 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { | 3718 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { |
3705 blink::WebPageVisibilityState current_state = is_hidden() ? | 3719 blink::WebPageVisibilityState current_state = is_hidden() ? |
3706 blink::WebPageVisibilityStateHidden : | 3720 blink::WebPageVisibilityStateHidden : |
3707 blink::WebPageVisibilityStateVisible; | 3721 blink::WebPageVisibilityStateVisible; |
3708 blink::WebPageVisibilityState override_state = current_state; | 3722 blink::WebPageVisibilityState override_state = current_state; |
3709 // TODO(jam): move this method to WebFrameClient. | 3723 // TODO(jam): move this method to WebFrameClient. |
3710 if (GetContentClient()->renderer()-> | 3724 if (GetContentClient()->renderer()-> |
3711 ShouldOverridePageVisibilityState(main_render_frame_.get(), | 3725 ShouldOverridePageVisibilityState(main_render_frame_.get(), |
3712 &override_state)) | 3726 &override_state)) |
3713 return override_state; | 3727 return override_state; |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4053 std::vector<gfx::Size> sizes; | 4067 std::vector<gfx::Size> sizes; |
4054 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4068 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4055 if (!url.isEmpty()) | 4069 if (!url.isEmpty()) |
4056 urls.push_back( | 4070 urls.push_back( |
4057 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4071 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4058 } | 4072 } |
4059 SendUpdateFaviconURL(urls); | 4073 SendUpdateFaviconURL(urls); |
4060 } | 4074 } |
4061 | 4075 |
4062 } // namespace content | 4076 } // namespace content |
OLD | NEW |