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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPlayingNotification, | 516 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPlayingNotification, |
517 OnMediaPlayingNotification) | 517 OnMediaPlayingNotification) |
518 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPausedNotification, | 518 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPausedNotification, |
519 OnMediaPausedNotification) | 519 OnMediaPausedNotification) |
520 IPC_MESSAGE_HANDLER(ViewHostMsg_DidLoadResourceFromMemoryCache, | 520 IPC_MESSAGE_HANDLER(ViewHostMsg_DidLoadResourceFromMemoryCache, |
521 OnDidLoadResourceFromMemoryCache) | 521 OnDidLoadResourceFromMemoryCache) |
522 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDisplayInsecureContent, | 522 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDisplayInsecureContent, |
523 OnDidDisplayInsecureContent) | 523 OnDidDisplayInsecureContent) |
524 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, | 524 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, |
525 OnDidRunInsecureContent) | 525 OnDidRunInsecureContent) |
| 526 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDetectXSS, OnDidDetectXSS) |
526 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 527 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
527 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 528 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
528 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 529 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
529 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, | 530 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
530 OnRegisterProtocolHandler) | 531 OnRegisterProtocolHandler) |
531 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) | 532 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
532 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 533 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
533 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) | 534 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) |
534 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, | 535 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, |
535 OnRequestPpapiBrokerPermission) | 536 OnRequestPpapiBrokerPermission) |
(...skipping 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 << target_url.possibly_invalid_spec(); | 2546 << target_url.possibly_invalid_spec(); |
2546 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); | 2547 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); |
2547 if (EndsWith(security_origin, kDotGoogleDotCom, false)) | 2548 if (EndsWith(security_origin, kDotGoogleDotCom, false)) |
2548 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); | 2549 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); |
2549 controller_.ssl_manager()->DidRunInsecureContent(security_origin); | 2550 controller_.ssl_manager()->DidRunInsecureContent(security_origin); |
2550 displayed_insecure_content_ = true; | 2551 displayed_insecure_content_ = true; |
2551 SSLManager::NotifySSLInternalStateChanged( | 2552 SSLManager::NotifySSLInternalStateChanged( |
2552 GetController().GetBrowserContext()); | 2553 GetController().GetBrowserContext()); |
2553 } | 2554 } |
2554 | 2555 |
| 2556 void WebContentsImpl::OnDidDetectXSS(int32 page_id, |
| 2557 const GURL& url, |
| 2558 bool blocked_entire_page) { |
| 2559 if (!blocked_entire_page) |
| 2560 return; |
| 2561 |
| 2562 // Preserve the entry for a possible subsequent view-source operation. |
| 2563 int entry_index = controller_.GetEntryIndexWithPageID( |
| 2564 GetRenderViewHost()->GetSiteInstance(), page_id); |
| 2565 NavigationEntry* entry = |
| 2566 entry_index < 0 ? NULL : controller_.GetEntryAtIndex(entry_index); |
| 2567 |
| 2568 controller_.SetBlockedPageEntry(entry); |
| 2569 } |
| 2570 |
2555 void WebContentsImpl::OnDocumentLoadedInFrame() { | 2571 void WebContentsImpl::OnDocumentLoadedInFrame() { |
2556 CHECK(render_frame_message_source_); | 2572 CHECK(render_frame_message_source_); |
2557 CHECK(!render_view_message_source_); | 2573 CHECK(!render_view_message_source_); |
2558 RenderFrameHostImpl* rfh = | 2574 RenderFrameHostImpl* rfh = |
2559 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); | 2575 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); |
2560 | 2576 |
2561 int render_frame_id = rfh->GetRoutingID(); | 2577 int render_frame_id = rfh->GetRoutingID(); |
2562 RenderViewHost* render_view_host = rfh->render_view_host(); | 2578 RenderViewHost* render_view_host = rfh->render_view_host(); |
2563 FOR_EACH_OBSERVER(WebContentsObserver, | 2579 FOR_EACH_OBSERVER(WebContentsObserver, |
2564 observers_, | 2580 observers_, |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4050 | 4066 |
4051 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4067 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
4052 if (!delegate_) | 4068 if (!delegate_) |
4053 return; | 4069 return; |
4054 const gfx::Size new_size = GetPreferredSize(); | 4070 const gfx::Size new_size = GetPreferredSize(); |
4055 if (new_size != old_size) | 4071 if (new_size != old_size) |
4056 delegate_->UpdatePreferredSize(this, new_size); | 4072 delegate_->UpdatePreferredSize(this, new_size); |
4057 } | 4073 } |
4058 | 4074 |
4059 } // namespace content | 4075 } // namespace content |
OLD | NEW |