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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
517 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPlayingNotification, | 517 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPlayingNotification, |
518 OnMediaPlayingNotification) | 518 OnMediaPlayingNotification) |
519 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPausedNotification, | 519 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPausedNotification, |
520 OnMediaPausedNotification) | 520 OnMediaPausedNotification) |
521 IPC_MESSAGE_HANDLER(ViewHostMsg_DidLoadResourceFromMemoryCache, | 521 IPC_MESSAGE_HANDLER(ViewHostMsg_DidLoadResourceFromMemoryCache, |
522 OnDidLoadResourceFromMemoryCache) | 522 OnDidLoadResourceFromMemoryCache) |
523 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDisplayInsecureContent, | 523 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDisplayInsecureContent, |
524 OnDidDisplayInsecureContent) | 524 OnDidDisplayInsecureContent) |
525 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, | 525 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, |
526 OnDidRunInsecureContent) | 526 OnDidRunInsecureContent) |
527 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDetectXSS, OnDidDetectXSS) | |
527 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 528 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
528 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 529 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
529 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 530 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
530 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, | 531 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
531 OnRegisterProtocolHandler) | 532 OnRegisterProtocolHandler) |
532 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) | 533 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
533 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 534 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
534 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) | 535 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) |
535 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, | 536 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, |
536 OnRequestPpapiBrokerPermission) | 537 OnRequestPpapiBrokerPermission) |
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2542 << target_url.possibly_invalid_spec(); | 2543 << target_url.possibly_invalid_spec(); |
2543 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); | 2544 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); |
2544 if (EndsWith(security_origin, kDotGoogleDotCom, false)) | 2545 if (EndsWith(security_origin, kDotGoogleDotCom, false)) |
2545 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); | 2546 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); |
2546 controller_.ssl_manager()->DidRunInsecureContent(security_origin); | 2547 controller_.ssl_manager()->DidRunInsecureContent(security_origin); |
2547 displayed_insecure_content_ = true; | 2548 displayed_insecure_content_ = true; |
2548 SSLManager::NotifySSLInternalStateChanged( | 2549 SSLManager::NotifySSLInternalStateChanged( |
2549 GetController().GetBrowserContext()); | 2550 GetController().GetBrowserContext()); |
2550 } | 2551 } |
2551 | 2552 |
2553 void WebContentsImpl::OnDidDetectXSS(const GURL& url, | |
2554 bool blocked_entire_page) { | |
2555 NavigationEntry* entry = controller_.GetLastCommittedEntry(); | |
sky
2014/06/03 22:12:16
How do you know lastcommittedentry is the right en
| |
2556 if (!entry) | |
2557 return; | |
2558 entry->SetExtraData("XSSDetected", | |
2559 base::ASCIIToUTF16(blocked_entire_page ? "1" : "0")); | |
2560 } | |
2561 | |
2552 void WebContentsImpl::OnDocumentLoadedInFrame() { | 2562 void WebContentsImpl::OnDocumentLoadedInFrame() { |
2553 CHECK(render_frame_message_source_); | 2563 CHECK(render_frame_message_source_); |
2554 CHECK(!render_view_message_source_); | 2564 CHECK(!render_view_message_source_); |
2555 RenderFrameHostImpl* rfh = | 2565 RenderFrameHostImpl* rfh = |
2556 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); | 2566 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); |
2557 | 2567 |
2558 int render_frame_id = rfh->GetRoutingID(); | 2568 int render_frame_id = rfh->GetRoutingID(); |
2559 RenderViewHost* render_view_host = rfh->render_view_host(); | 2569 RenderViewHost* render_view_host = rfh->render_view_host(); |
2560 FOR_EACH_OBSERVER(WebContentsObserver, | 2570 FOR_EACH_OBSERVER(WebContentsObserver, |
2561 observers_, | 2571 observers_, |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4047 | 4057 |
4048 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4058 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
4049 if (!delegate_) | 4059 if (!delegate_) |
4050 return; | 4060 return; |
4051 const gfx::Size new_size = GetPreferredSize(); | 4061 const gfx::Size new_size = GetPreferredSize(); |
4052 if (new_size != old_size) | 4062 if (new_size != old_size) |
4053 delegate_->UpdatePreferredSize(this, new_size); | 4063 delegate_->UpdatePreferredSize(this, new_size); |
4054 } | 4064 } |
4055 | 4065 |
4056 } // namespace content | 4066 } // namespace content |
OLD | NEW |