| 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 545 } |
| 546 | 546 |
| 547 bool handled = true; | 547 bool handled = true; |
| 548 IPC_BEGIN_MESSAGE_MAP(WebContentsImpl, message) | 548 IPC_BEGIN_MESSAGE_MAP(WebContentsImpl, message) |
| 549 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) | 549 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) |
| 550 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) | 550 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) |
| 551 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse, | 551 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse, |
| 552 OnDomOperationResponse) | 552 OnDomOperationResponse) |
| 553 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeThemeColor, | 553 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeThemeColor, |
| 554 OnThemeColorChanged) | 554 OnThemeColorChanged) |
| 555 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDetectXSS, OnDidDetectXSS) | |
| 556 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad, | 555 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad, |
| 557 OnDocumentLoadedInFrame) | 556 OnDocumentLoadedInFrame) |
| 558 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishLoad, OnDidFinishLoad) | 557 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishLoad, OnDidFinishLoad) |
| 559 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartLoading, OnDidStartLoading) | 558 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartLoading, OnDidStartLoading) |
| 560 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStopLoading, OnDidStopLoading) | 559 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStopLoading, OnDidStopLoading) |
| 561 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeLoadProgress, | 560 IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeLoadProgress, |
| 562 OnDidChangeLoadProgress) | 561 OnDidChangeLoadProgress) |
| 563 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenColorChooser, OnOpenColorChooser) | 562 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenColorChooser, OnOpenColorChooser) |
| 564 IPC_MESSAGE_HANDLER(FrameHostMsg_EndColorChooser, OnEndColorChooser) | 563 IPC_MESSAGE_HANDLER(FrameHostMsg_EndColorChooser, OnEndColorChooser) |
| 565 IPC_MESSAGE_HANDLER(FrameHostMsg_SetSelectedColorInColorChooser, | 564 IPC_MESSAGE_HANDLER(FrameHostMsg_SetSelectedColorInColorChooser, |
| (...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2671 << target_url.possibly_invalid_spec(); | 2670 << target_url.possibly_invalid_spec(); |
| 2672 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); | 2671 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); |
| 2673 if (EndsWith(security_origin, kDotGoogleDotCom, false)) | 2672 if (EndsWith(security_origin, kDotGoogleDotCom, false)) |
| 2674 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); | 2673 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); |
| 2675 controller_.ssl_manager()->DidRunInsecureContent(security_origin); | 2674 controller_.ssl_manager()->DidRunInsecureContent(security_origin); |
| 2676 displayed_insecure_content_ = true; | 2675 displayed_insecure_content_ = true; |
| 2677 SSLManager::NotifySSLInternalStateChanged( | 2676 SSLManager::NotifySSLInternalStateChanged( |
| 2678 GetController().GetBrowserContext()); | 2677 GetController().GetBrowserContext()); |
| 2679 } | 2678 } |
| 2680 | 2679 |
| 2681 | |
| 2682 void WebContentsImpl::OnDidDetectXSS(int32 page_id, | |
| 2683 const GURL& url, | |
| 2684 bool blocked_entire_page) { | |
| 2685 if (!blocked_entire_page) | |
| 2686 return; | |
| 2687 | |
| 2688 int entry_index = controller_.GetEntryIndexWithPageID( | |
| 2689 GetRenderViewHost()->GetSiteInstance(), page_id); | |
| 2690 if (entry_index < 0) | |
| 2691 return; | |
| 2692 | |
| 2693 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( | |
| 2694 controller_.GetEntryAtIndex(entry_index)); | |
| 2695 if (!entry) | |
| 2696 return; | |
| 2697 | |
| 2698 entry->set_xss_detected(true); | |
| 2699 } | |
| 2700 | |
| 2701 void WebContentsImpl::OnDocumentLoadedInFrame() { | 2680 void WebContentsImpl::OnDocumentLoadedInFrame() { |
| 2702 CHECK(render_frame_message_source_); | 2681 CHECK(render_frame_message_source_); |
| 2703 CHECK(!render_view_message_source_); | 2682 CHECK(!render_view_message_source_); |
| 2704 RenderFrameHostImpl* rfh = | 2683 RenderFrameHostImpl* rfh = |
| 2705 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); | 2684 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); |
| 2706 FOR_EACH_OBSERVER( | 2685 FOR_EACH_OBSERVER( |
| 2707 WebContentsObserver, observers_, DocumentLoadedInFrame(rfh)); | 2686 WebContentsObserver, observers_, DocumentLoadedInFrame(rfh)); |
| 2708 } | 2687 } |
| 2709 | 2688 |
| 2710 void WebContentsImpl::OnDidFinishLoad( | 2689 void WebContentsImpl::OnDidFinishLoad( |
| (...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4245 if (new_size != old_size) | 4224 if (new_size != old_size) |
| 4246 delegate_->UpdatePreferredSize(this, new_size); | 4225 delegate_->UpdatePreferredSize(this, new_size); |
| 4247 } | 4226 } |
| 4248 | 4227 |
| 4249 void WebContentsImpl::ResumeResponseDeferredAtStart() { | 4228 void WebContentsImpl::ResumeResponseDeferredAtStart() { |
| 4250 FrameTreeNode* node = frame_tree_.root(); | 4229 FrameTreeNode* node = frame_tree_.root(); |
| 4251 node->render_manager()->ResumeResponseDeferredAtStart(); | 4230 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4252 } | 4231 } |
| 4253 | 4232 |
| 4254 } // namespace content | 4233 } // namespace content |
| OLD | NEW |