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 3649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3660 if (base.GetOrigin() != absolute_url.GetOrigin()) { | 3660 if (base.GetOrigin() != absolute_url.GetOrigin()) { |
3661 return; | 3661 return; |
3662 } | 3662 } |
3663 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, | 3663 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, |
3664 base::UTF16ToUTF8(scheme), | 3664 base::UTF16ToUTF8(scheme), |
3665 absolute_url, | 3665 absolute_url, |
3666 title, | 3666 title, |
3667 user_gesture)); | 3667 user_gesture)); |
3668 } | 3668 } |
3669 | 3669 |
3670 void RenderViewImpl::unregisterProtocolHandler(const WebString& scheme, | |
3671 const WebURL& base_url, | |
3672 const WebURL& url) { | |
3673 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); | |
3674 GURL base(base_url); | |
3675 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string())); | |
3676 if (base.GetOrigin() != absolute_url.GetOrigin()) { | |
jochen (gone - plz use gerrit)
2014/07/09 09:12:56
no { }
gyuyoung-inactive
2014/07/09 09:32:16
Done.
| |
3677 return; | |
3678 } | |
3679 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_, | |
3680 base::UTF16ToUTF8(scheme), | |
3681 absolute_url, | |
3682 user_gesture)); | |
3683 } | |
3684 | |
3670 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { | 3685 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { |
3671 blink::WebPageVisibilityState current_state = is_hidden() ? | 3686 blink::WebPageVisibilityState current_state = is_hidden() ? |
3672 blink::WebPageVisibilityStateHidden : | 3687 blink::WebPageVisibilityStateHidden : |
3673 blink::WebPageVisibilityStateVisible; | 3688 blink::WebPageVisibilityStateVisible; |
3674 blink::WebPageVisibilityState override_state = current_state; | 3689 blink::WebPageVisibilityState override_state = current_state; |
3675 // TODO(jam): move this method to WebFrameClient. | 3690 // TODO(jam): move this method to WebFrameClient. |
3676 if (GetContentClient()->renderer()-> | 3691 if (GetContentClient()->renderer()-> |
3677 ShouldOverridePageVisibilityState(main_render_frame_.get(), | 3692 ShouldOverridePageVisibilityState(main_render_frame_.get(), |
3678 &override_state)) | 3693 &override_state)) |
3679 return override_state; | 3694 return override_state; |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3983 std::vector<gfx::Size> sizes; | 3998 std::vector<gfx::Size> sizes; |
3984 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3999 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3985 if (!url.isEmpty()) | 4000 if (!url.isEmpty()) |
3986 urls.push_back( | 4001 urls.push_back( |
3987 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4002 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3988 } | 4003 } |
3989 SendUpdateFaviconURL(urls); | 4004 SendUpdateFaviconURL(urls); |
3990 } | 4005 } |
3991 | 4006 |
3992 } // namespace content | 4007 } // namespace content |
OLD | NEW |