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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 767 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
768 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, | 768 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, |
769 OnPageScaleFactorChanged) | 769 OnPageScaleFactorChanged) |
770 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 770 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
771 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 771 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
772 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) | 772 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) |
773 #if BUILDFLAG(ENABLE_PLUGINS) | 773 #if BUILDFLAG(ENABLE_PLUGINS) |
774 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, | 774 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, |
775 OnRequestPpapiBrokerPermission) | 775 OnRequestPpapiBrokerPermission) |
776 #endif | 776 #endif |
777 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) | |
778 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowValidationMessage, | 777 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowValidationMessage, |
779 OnShowValidationMessage) | 778 OnShowValidationMessage) |
780 IPC_MESSAGE_HANDLER(ViewHostMsg_HideValidationMessage, | 779 IPC_MESSAGE_HANDLER(ViewHostMsg_HideValidationMessage, |
781 OnHideValidationMessage) | 780 OnHideValidationMessage) |
782 IPC_MESSAGE_HANDLER(ViewHostMsg_MoveValidationMessage, | 781 IPC_MESSAGE_HANDLER(ViewHostMsg_MoveValidationMessage, |
783 OnMoveValidationMessage) | 782 OnMoveValidationMessage) |
784 #if defined(OS_ANDROID) | 783 #if defined(OS_ANDROID) |
785 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenDateTimeDialog, OnOpenDateTimeDialog) | 784 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenDateTimeDialog, OnOpenDateTimeDialog) |
786 #endif | 785 #endif |
787 IPC_MESSAGE_UNHANDLED(handled = false) | 786 IPC_MESSAGE_UNHANDLED(handled = false) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 OnDidDisplayContentWithCertificateErrors) | 821 OnDidDisplayContentWithCertificateErrors) |
823 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunContentWithCertificateErrors, | 822 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunContentWithCertificateErrors, |
824 OnDidRunContentWithCertificateErrors) | 823 OnDidRunContentWithCertificateErrors) |
825 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, | 824 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, |
826 OnRegisterProtocolHandler) | 825 OnRegisterProtocolHandler) |
827 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, | 826 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, |
828 OnUnregisterProtocolHandler) | 827 OnUnregisterProtocolHandler) |
829 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, | 828 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, |
830 OnUpdatePageImportanceSignals) | 829 OnUpdatePageImportanceSignals) |
831 IPC_MESSAGE_HANDLER(FrameHostMsg_Find_Reply, OnFindReply) | 830 IPC_MESSAGE_HANDLER(FrameHostMsg_Find_Reply, OnFindReply) |
| 831 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) |
832 #if BUILDFLAG(ENABLE_PLUGINS) | 832 #if BUILDFLAG(ENABLE_PLUGINS) |
833 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated, | 833 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated, |
834 OnPepperInstanceCreated) | 834 OnPepperInstanceCreated) |
835 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceDeleted, | 835 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceDeleted, |
836 OnPepperInstanceDeleted) | 836 OnPepperInstanceDeleted) |
837 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) | 837 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) |
838 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStartsPlayback, | 838 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStartsPlayback, |
839 OnPepperStartsPlayback) | 839 OnPepperStartsPlayback) |
840 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStopsPlayback, | 840 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStopsPlayback, |
841 OnPepperStopsPlayback) | 841 OnPepperStopsPlayback) |
(...skipping 3295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4137 | 4137 |
4138 void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host, | 4138 void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host, |
4139 const IPC::Message& message) { | 4139 const IPC::Message& message) { |
4140 CHECK(!browser_plugin_embedder_.get()); | 4140 CHECK(!browser_plugin_embedder_.get()); |
4141 CreateBrowserPluginEmbedderIfNecessary(); | 4141 CreateBrowserPluginEmbedderIfNecessary(); |
4142 browser_plugin_embedder_->OnMessageReceived(message, render_frame_host); | 4142 browser_plugin_embedder_->OnMessageReceived(message, render_frame_host); |
4143 } | 4143 } |
4144 #endif // BUILDFLAG(ENABLE_PLUGINS) | 4144 #endif // BUILDFLAG(ENABLE_PLUGINS) |
4145 | 4145 |
4146 void WebContentsImpl::OnUpdateFaviconURL( | 4146 void WebContentsImpl::OnUpdateFaviconURL( |
4147 RenderViewHostImpl* source, | 4147 RenderFrameHostImpl* source, |
4148 const std::vector<FaviconURL>& candidates) { | 4148 const std::vector<FaviconURL>& candidates) { |
| 4149 // Ignore favicons for non-main frame. |
| 4150 if (source->GetParent()) { |
| 4151 NOTREACHED(); |
| 4152 return; |
| 4153 } |
| 4154 |
4149 // We get updated favicon URLs after the page stops loading. If a cross-site | 4155 // We get updated favicon URLs after the page stops loading. If a cross-site |
4150 // navigation occurs while a page is still loading, the initial page | 4156 // navigation occurs while a page is still loading, the initial page |
4151 // may stop loading and send us updated favicon URLs after the navigation | 4157 // may stop loading and send us updated favicon URLs after the navigation |
4152 // for the new page has committed. | 4158 // for the new page has committed. |
4153 if (!source->is_active()) | 4159 if (!source->IsCurrent()) |
4154 return; | 4160 return; |
4155 | 4161 |
4156 for (auto& observer : observers_) | 4162 for (auto& observer : observers_) |
4157 observer.DidUpdateFaviconURL(candidates); | 4163 observer.DidUpdateFaviconURL(candidates); |
4158 } | 4164 } |
4159 | 4165 |
4160 void WebContentsImpl::OnPasswordInputShownOnHttp() { | 4166 void WebContentsImpl::OnPasswordInputShownOnHttp() { |
4161 controller_.ssl_manager()->DidShowPasswordInputOnHttp(); | 4167 controller_.ssl_manager()->DidShowPasswordInputOnHttp(); |
4162 } | 4168 } |
4163 | 4169 |
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5708 new_root->SetOriginalOpener(opener->frame_tree()->root()); | 5714 new_root->SetOriginalOpener(opener->frame_tree()->root()); |
5709 | 5715 |
5710 if (!opener_suppressed) { | 5716 if (!opener_suppressed) { |
5711 new_root->SetOpener(opener); | 5717 new_root->SetOpener(opener); |
5712 created_with_opener_ = true; | 5718 created_with_opener_ = true; |
5713 } | 5719 } |
5714 } | 5720 } |
5715 } | 5721 } |
5716 | 5722 |
5717 } // namespace content | 5723 } // namespace content |
OLD | NEW |