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 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2719 return; | 2721 return; |
2720 | 2722 |
2721 ChildProcessSecurityPolicyImpl* policy = | 2723 ChildProcessSecurityPolicyImpl* policy = |
2722 ChildProcessSecurityPolicyImpl::GetInstance(); | 2724 ChildProcessSecurityPolicyImpl::GetInstance(); |
2723 if (policy->IsPseudoScheme(protocol)) | 2725 if (policy->IsPseudoScheme(protocol)) |
2724 return; | 2726 return; |
2725 | 2727 |
2726 delegate_->RegisterProtocolHandler(this, protocol, url, user_gesture); | 2728 delegate_->RegisterProtocolHandler(this, protocol, url, user_gesture); |
2727 } | 2729 } |
2728 | 2730 |
| 2731 void WebContentsImpl::OnUnregisterProtocolHandler(const std::string& protocol, |
| 2732 const GURL& url, |
| 2733 bool user_gesture) { |
| 2734 if (!delegate_) |
| 2735 return; |
| 2736 |
| 2737 ChildProcessSecurityPolicyImpl* policy = |
| 2738 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 2739 if (policy->IsPseudoScheme(protocol)) |
| 2740 return; |
| 2741 |
| 2742 delegate_->UnregisterProtocolHandler(this, protocol, url, user_gesture); |
| 2743 } |
| 2744 |
2729 void WebContentsImpl::OnFindReply(int request_id, | 2745 void WebContentsImpl::OnFindReply(int request_id, |
2730 int number_of_matches, | 2746 int number_of_matches, |
2731 const gfx::Rect& selection_rect, | 2747 const gfx::Rect& selection_rect, |
2732 int active_match_ordinal, | 2748 int active_match_ordinal, |
2733 bool final_update) { | 2749 bool final_update) { |
2734 if (delegate_) { | 2750 if (delegate_) { |
2735 delegate_->FindReply(this, request_id, number_of_matches, selection_rect, | 2751 delegate_->FindReply(this, request_id, number_of_matches, selection_rect, |
2736 active_match_ordinal, final_update); | 2752 active_match_ordinal, final_update); |
2737 } | 2753 } |
2738 } | 2754 } |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4100 if (new_size != old_size) | 4116 if (new_size != old_size) |
4101 delegate_->UpdatePreferredSize(this, new_size); | 4117 delegate_->UpdatePreferredSize(this, new_size); |
4102 } | 4118 } |
4103 | 4119 |
4104 void WebContentsImpl::ResumeResponseDeferredAtStart() { | 4120 void WebContentsImpl::ResumeResponseDeferredAtStart() { |
4105 FrameTreeNode* node = frame_tree_.root(); | 4121 FrameTreeNode* node = frame_tree_.root(); |
4106 node->render_manager()->ResumeResponseDeferredAtStart(); | 4122 node->render_manager()->ResumeResponseDeferredAtStart(); |
4107 } | 4123 } |
4108 | 4124 |
4109 } // namespace content | 4125 } // namespace content |
OLD | NEW |