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 3957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3968 if (base.GetOrigin() != absolute_url.GetOrigin()) { | 3968 if (base.GetOrigin() != absolute_url.GetOrigin()) { |
3969 return; | 3969 return; |
3970 } | 3970 } |
3971 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, | 3971 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, |
3972 base::UTF16ToUTF8(scheme), | 3972 base::UTF16ToUTF8(scheme), |
3973 absolute_url, | 3973 absolute_url, |
3974 title, | 3974 title, |
3975 user_gesture)); | 3975 user_gesture)); |
3976 } | 3976 } |
3977 | 3977 |
| 3978 void RenderViewImpl::unregisterProtocolHandler(const WebString& scheme, |
| 3979 const WebURL& base_url, |
| 3980 const WebURL& url) { |
| 3981 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); |
| 3982 GURL base(base_url); |
| 3983 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); |
| 3984 if (base.GetOrigin() != absolute_url.GetOrigin()) |
| 3985 return; |
| 3986 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, |
| 3987 base::UTF16ToUTF8(scheme), |
| 3988 absolute_url, |
| 3989 user_gesture)); |
| 3990 } |
| 3991 |
3978 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { | 3992 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { |
3979 blink::WebPageVisibilityState current_state = is_hidden() ? | 3993 blink::WebPageVisibilityState current_state = is_hidden() ? |
3980 blink::WebPageVisibilityStateHidden : | 3994 blink::WebPageVisibilityStateHidden : |
3981 blink::WebPageVisibilityStateVisible; | 3995 blink::WebPageVisibilityStateVisible; |
3982 blink::WebPageVisibilityState override_state = current_state; | 3996 blink::WebPageVisibilityState override_state = current_state; |
3983 // TODO(jam): move this method to WebFrameClient. | 3997 // TODO(jam): move this method to WebFrameClient. |
3984 if (GetContentClient()->renderer()-> | 3998 if (GetContentClient()->renderer()-> |
3985 ShouldOverridePageVisibilityState(main_render_frame_.get(), | 3999 ShouldOverridePageVisibilityState(main_render_frame_.get(), |
3986 &override_state)) | 4000 &override_state)) |
3987 return override_state; | 4001 return override_state; |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4291 std::vector<gfx::Size> sizes; | 4305 std::vector<gfx::Size> sizes; |
4292 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4306 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4293 if (!url.isEmpty()) | 4307 if (!url.isEmpty()) |
4294 urls.push_back( | 4308 urls.push_back( |
4295 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4309 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4296 } | 4310 } |
4297 SendUpdateFaviconURL(urls); | 4311 SendUpdateFaviconURL(urls); |
4298 } | 4312 } |
4299 | 4313 |
4300 } // namespace content | 4314 } // namespace content |
OLD | NEW |