Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 294023010: Implement unregisterProtocolHandler() for content layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3648 matching lines...) Expand 10 before | Expand all | Expand 10 after
3659 if (base.GetOrigin() != absolute_url.GetOrigin()) { 3659 if (base.GetOrigin() != absolute_url.GetOrigin()) {
3660 return; 3660 return;
3661 } 3661 }
3662 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, 3662 Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_,
3663 base::UTF16ToUTF8(scheme), 3663 base::UTF16ToUTF8(scheme),
3664 absolute_url, 3664 absolute_url,
3665 title, 3665 title,
3666 user_gesture)); 3666 user_gesture));
3667 } 3667 }
3668 3668
3669 void RenderViewImpl::unregisterProtocolHandler(const WebString& scheme,
3670 const WebURL& base_url,
3671 const WebURL& url) {
3672 bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture();
3673 GURL base(base_url);
3674 GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url.string()));
3675 if (base.GetOrigin() != absolute_url.GetOrigin())
3676 return;
3677 Send(new ViewHostMsg_UnregisterProtocolHandler(routing_id_,
3678 base::UTF16ToUTF8(scheme),
3679 absolute_url,
3680 user_gesture));
3681 }
3682
3669 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const { 3683 blink::WebPageVisibilityState RenderViewImpl::visibilityState() const {
3670 blink::WebPageVisibilityState current_state = is_hidden() ? 3684 blink::WebPageVisibilityState current_state = is_hidden() ?
3671 blink::WebPageVisibilityStateHidden : 3685 blink::WebPageVisibilityStateHidden :
3672 blink::WebPageVisibilityStateVisible; 3686 blink::WebPageVisibilityStateVisible;
3673 blink::WebPageVisibilityState override_state = current_state; 3687 blink::WebPageVisibilityState override_state = current_state;
3674 // TODO(jam): move this method to WebFrameClient. 3688 // TODO(jam): move this method to WebFrameClient.
3675 if (GetContentClient()->renderer()-> 3689 if (GetContentClient()->renderer()->
3676 ShouldOverridePageVisibilityState(main_render_frame_.get(), 3690 ShouldOverridePageVisibilityState(main_render_frame_.get(),
3677 &override_state)) 3691 &override_state))
3678 return override_state; 3692 return override_state;
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
3982 std::vector<gfx::Size> sizes; 3996 std::vector<gfx::Size> sizes;
3983 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 3997 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
3984 if (!url.isEmpty()) 3998 if (!url.isEmpty())
3985 urls.push_back( 3999 urls.push_back(
3986 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4000 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
3987 } 4001 }
3988 SendUpdateFaviconURL(urls); 4002 SendUpdateFaviconURL(urls);
3989 } 4003 }
3990 4004
3991 } // namespace content 4005 } // namespace content
OLDNEW
« content/common/view_messages.h ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698