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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
527 OnDidLoadResourceFromMemoryCache) | 527 OnDidLoadResourceFromMemoryCache) |
528 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDisplayInsecureContent, | 528 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDisplayInsecureContent, |
529 OnDidDisplayInsecureContent) | 529 OnDidDisplayInsecureContent) |
530 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, | 530 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, |
531 OnDidRunInsecureContent) | 531 OnDidRunInsecureContent) |
532 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 532 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
533 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 533 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
534 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 534 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
535 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, | 535 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
536 OnRegisterProtocolHandler) | 536 OnRegisterProtocolHandler) |
537 IPC_MESSAGE_HANDLER(ViewHostMsg_UnregisterProtocolHandler, | |
538 OnUnregisterProtocolHandler) | |
537 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) | 539 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
538 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 540 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
539 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) | 541 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) |
540 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, | 542 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, |
541 OnRequestPpapiBrokerPermission) | 543 OnRequestPpapiBrokerPermission) |
542 IPC_MESSAGE_HANDLER_GENERIC(BrowserPluginHostMsg_Attach, | 544 IPC_MESSAGE_HANDLER_GENERIC(BrowserPluginHostMsg_Attach, |
543 OnBrowserPluginMessage(message)) | 545 OnBrowserPluginMessage(message)) |
544 IPC_MESSAGE_HANDLER(ImageHostMsg_DidDownloadImage, OnDidDownloadImage) | 546 IPC_MESSAGE_HANDLER(ImageHostMsg_DidDownloadImage, OnDidDownloadImage) |
545 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) | 547 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) |
546 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstVisuallyNonEmptyPaint, | 548 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstVisuallyNonEmptyPaint, |
(...skipping 2182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2729 return; | 2731 return; |
2730 | 2732 |
2731 ChildProcessSecurityPolicyImpl* policy = | 2733 ChildProcessSecurityPolicyImpl* policy = |
2732 ChildProcessSecurityPolicyImpl::GetInstance(); | 2734 ChildProcessSecurityPolicyImpl::GetInstance(); |
2733 if (policy->IsPseudoScheme(protocol)) | 2735 if (policy->IsPseudoScheme(protocol)) |
2734 return; | 2736 return; |
2735 | 2737 |
2736 delegate_->RegisterProtocolHandler(this, protocol, url, user_gesture); | 2738 delegate_->RegisterProtocolHandler(this, protocol, url, user_gesture); |
2737 } | 2739 } |
2738 | 2740 |
2741 void WebContentsImpl::OnUnregisterProtocolHandler(const std::string& protocol, | |
2742 const GURL& url, | |
2743 bool user_gesture) { | |
2744 if (!delegate_) | |
2745 return; | |
2746 | |
2747 ChildProcessSecurityPolicyImpl* policy = | |
2748 ChildProcessSecurityPolicyImpl::GetInstance(); | |
2749 if (policy->IsPseudoScheme(protocol)) | |
2750 return; | |
2751 | |
2752 delegate_->UnregisterProtocolHandler(this, protocol, url, user_gesture); | |
jochen (gone - plz use gerrit)
2014/07/10 11:30:07
can you please implement this as well? (i.e. Brows
| |
2753 } | |
2754 | |
2739 void WebContentsImpl::OnFindReply(int request_id, | 2755 void WebContentsImpl::OnFindReply(int request_id, |
2740 int number_of_matches, | 2756 int number_of_matches, |
2741 const gfx::Rect& selection_rect, | 2757 const gfx::Rect& selection_rect, |
2742 int active_match_ordinal, | 2758 int active_match_ordinal, |
2743 bool final_update) { | 2759 bool final_update) { |
2744 if (delegate_) { | 2760 if (delegate_) { |
2745 delegate_->FindReply(this, request_id, number_of_matches, selection_rect, | 2761 delegate_->FindReply(this, request_id, number_of_matches, selection_rect, |
2746 active_match_ordinal, final_update); | 2762 active_match_ordinal, final_update); |
2747 } | 2763 } |
2748 } | 2764 } |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4107 if (new_size != old_size) | 4123 if (new_size != old_size) |
4108 delegate_->UpdatePreferredSize(this, new_size); | 4124 delegate_->UpdatePreferredSize(this, new_size); |
4109 } | 4125 } |
4110 | 4126 |
4111 void WebContentsImpl::ResumeResponseDeferredAtStart() { | 4127 void WebContentsImpl::ResumeResponseDeferredAtStart() { |
4112 FrameTreeNode* node = frame_tree_.root(); | 4128 FrameTreeNode* node = frame_tree_.root(); |
4113 node->render_manager()->ResumeResponseDeferredAtStart(); | 4129 node->render_manager()->ResumeResponseDeferredAtStart(); |
4114 } | 4130 } |
4115 | 4131 |
4116 } // namespace content | 4132 } // namespace content |
OLD | NEW |