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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 773 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
774 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, | 774 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, |
775 OnPageScaleFactorChanged) | 775 OnPageScaleFactorChanged) |
776 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 776 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
777 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 777 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
778 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) | 778 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) |
779 #if BUILDFLAG(ENABLE_PLUGINS) | 779 #if BUILDFLAG(ENABLE_PLUGINS) |
780 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, | 780 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, |
781 OnRequestPpapiBrokerPermission) | 781 OnRequestPpapiBrokerPermission) |
782 #endif | 782 #endif |
783 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) | |
784 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowValidationMessage, | 783 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowValidationMessage, |
785 OnShowValidationMessage) | 784 OnShowValidationMessage) |
786 IPC_MESSAGE_HANDLER(ViewHostMsg_HideValidationMessage, | 785 IPC_MESSAGE_HANDLER(ViewHostMsg_HideValidationMessage, |
787 OnHideValidationMessage) | 786 OnHideValidationMessage) |
788 IPC_MESSAGE_HANDLER(ViewHostMsg_MoveValidationMessage, | 787 IPC_MESSAGE_HANDLER(ViewHostMsg_MoveValidationMessage, |
789 OnMoveValidationMessage) | 788 OnMoveValidationMessage) |
790 #if defined(OS_ANDROID) | 789 #if defined(OS_ANDROID) |
791 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenDateTimeDialog, OnOpenDateTimeDialog) | 790 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenDateTimeDialog, OnOpenDateTimeDialog) |
792 #endif | 791 #endif |
793 IPC_MESSAGE_UNHANDLED(handled = false) | 792 IPC_MESSAGE_UNHANDLED(handled = false) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 OnDidDisplayContentWithCertificateErrors) | 827 OnDidDisplayContentWithCertificateErrors) |
829 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunContentWithCertificateErrors, | 828 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunContentWithCertificateErrors, |
830 OnDidRunContentWithCertificateErrors) | 829 OnDidRunContentWithCertificateErrors) |
831 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, | 830 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, |
832 OnRegisterProtocolHandler) | 831 OnRegisterProtocolHandler) |
833 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, | 832 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, |
834 OnUnregisterProtocolHandler) | 833 OnUnregisterProtocolHandler) |
835 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, | 834 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, |
836 OnUpdatePageImportanceSignals) | 835 OnUpdatePageImportanceSignals) |
837 IPC_MESSAGE_HANDLER(FrameHostMsg_Find_Reply, OnFindReply) | 836 IPC_MESSAGE_HANDLER(FrameHostMsg_Find_Reply, OnFindReply) |
| 837 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) |
838 #if BUILDFLAG(ENABLE_PLUGINS) | 838 #if BUILDFLAG(ENABLE_PLUGINS) |
839 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated, | 839 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated, |
840 OnPepperInstanceCreated) | 840 OnPepperInstanceCreated) |
841 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceDeleted, | 841 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceDeleted, |
842 OnPepperInstanceDeleted) | 842 OnPepperInstanceDeleted) |
843 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) | 843 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) |
844 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStartsPlayback, | 844 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStartsPlayback, |
845 OnPepperStartsPlayback) | 845 OnPepperStartsPlayback) |
846 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStopsPlayback, | 846 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperStopsPlayback, |
847 OnPepperStopsPlayback) | 847 OnPepperStopsPlayback) |
(...skipping 3294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4142 | 4142 |
4143 void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host, | 4143 void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host, |
4144 const IPC::Message& message) { | 4144 const IPC::Message& message) { |
4145 CHECK(!browser_plugin_embedder_.get()); | 4145 CHECK(!browser_plugin_embedder_.get()); |
4146 CreateBrowserPluginEmbedderIfNecessary(); | 4146 CreateBrowserPluginEmbedderIfNecessary(); |
4147 browser_plugin_embedder_->OnMessageReceived(message, render_frame_host); | 4147 browser_plugin_embedder_->OnMessageReceived(message, render_frame_host); |
4148 } | 4148 } |
4149 #endif // BUILDFLAG(ENABLE_PLUGINS) | 4149 #endif // BUILDFLAG(ENABLE_PLUGINS) |
4150 | 4150 |
4151 void WebContentsImpl::OnUpdateFaviconURL( | 4151 void WebContentsImpl::OnUpdateFaviconURL( |
4152 RenderViewHostImpl* source, | 4152 RenderFrameHostImpl* source, |
4153 const std::vector<FaviconURL>& candidates) { | 4153 const std::vector<FaviconURL>& candidates) { |
| 4154 // Ignore favicons for non-main frame. |
| 4155 if (source->GetParent()) { |
| 4156 NOTREACHED(); |
| 4157 return; |
| 4158 } |
| 4159 |
4154 // We get updated favicon URLs after the page stops loading. If a cross-site | 4160 // We get updated favicon URLs after the page stops loading. If a cross-site |
4155 // navigation occurs while a page is still loading, the initial page | 4161 // navigation occurs while a page is still loading, the initial page |
4156 // may stop loading and send us updated favicon URLs after the navigation | 4162 // may stop loading and send us updated favicon URLs after the navigation |
4157 // for the new page has committed. | 4163 // for the new page has committed. |
4158 if (!source->is_active()) | 4164 if (!source->IsCurrent()) |
4159 return; | 4165 return; |
4160 | 4166 |
4161 for (auto& observer : observers_) | 4167 for (auto& observer : observers_) |
4162 observer.DidUpdateFaviconURL(candidates); | 4168 observer.DidUpdateFaviconURL(candidates); |
4163 } | 4169 } |
4164 | 4170 |
4165 void WebContentsImpl::OnPasswordInputShownOnHttp() { | 4171 void WebContentsImpl::OnPasswordInputShownOnHttp() { |
4166 controller_.ssl_manager()->DidShowPasswordInputOnHttp(); | 4172 controller_.ssl_manager()->DidShowPasswordInputOnHttp(); |
4167 } | 4173 } |
4168 | 4174 |
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5676 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5682 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
5677 if (!render_view_host) | 5683 if (!render_view_host) |
5678 continue; | 5684 continue; |
5679 render_view_host_set.insert(render_view_host); | 5685 render_view_host_set.insert(render_view_host); |
5680 } | 5686 } |
5681 for (RenderViewHost* render_view_host : render_view_host_set) | 5687 for (RenderViewHost* render_view_host : render_view_host_set) |
5682 render_view_host->OnWebkitPreferencesChanged(); | 5688 render_view_host->OnWebkitPreferencesChanged(); |
5683 } | 5689 } |
5684 | 5690 |
5685 } // namespace content | 5691 } // namespace content |
OLD | NEW |