| 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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 | 2227 |
| 2228 NotificationService::current()->Notify( | 2228 NotificationService::current()->Notify( |
| 2229 NOTIFICATION_LOAD_FROM_MEMORY_CACHE, | 2229 NOTIFICATION_LOAD_FROM_MEMORY_CACHE, |
| 2230 Source<NavigationController>(&controller_), | 2230 Source<NavigationController>(&controller_), |
| 2231 Details<LoadFromMemoryCacheDetails>(&details)); | 2231 Details<LoadFromMemoryCacheDetails>(&details)); |
| 2232 } | 2232 } |
| 2233 | 2233 |
| 2234 void WebContentsImpl::OnDidDisplayInsecureContent() { | 2234 void WebContentsImpl::OnDidDisplayInsecureContent() { |
| 2235 RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); | 2235 RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); |
| 2236 displayed_insecure_content_ = true; | 2236 displayed_insecure_content_ = true; |
| 2237 SSLManager::NotifySSLInternalStateChanged(&GetController()); | 2237 SSLManager::NotifySSLInternalStateChanged( |
| 2238 GetController().GetBrowserContext()); |
| 2238 } | 2239 } |
| 2239 | 2240 |
| 2240 void WebContentsImpl::OnDidRunInsecureContent( | 2241 void WebContentsImpl::OnDidRunInsecureContent( |
| 2241 const std::string& security_origin, const GURL& target_url) { | 2242 const std::string& security_origin, const GURL& target_url) { |
| 2242 LOG(INFO) << security_origin << " ran insecure content from " | 2243 LOG(INFO) << security_origin << " ran insecure content from " |
| 2243 << target_url.possibly_invalid_spec(); | 2244 << target_url.possibly_invalid_spec(); |
| 2244 RecordAction(UserMetricsAction("SSL.RanInsecureContent")); | 2245 RecordAction(UserMetricsAction("SSL.RanInsecureContent")); |
| 2245 if (EndsWith(security_origin, kDotGoogleDotCom, false)) | 2246 if (EndsWith(security_origin, kDotGoogleDotCom, false)) |
| 2246 RecordAction(UserMetricsAction("SSL.RanInsecureContentGoogle")); | 2247 RecordAction(UserMetricsAction("SSL.RanInsecureContentGoogle")); |
| 2247 controller_.ssl_manager()->DidRunInsecureContent(security_origin); | 2248 controller_.ssl_manager()->DidRunInsecureContent(security_origin); |
| 2248 displayed_insecure_content_ = true; | 2249 displayed_insecure_content_ = true; |
| 2249 SSLManager::NotifySSLInternalStateChanged(&GetController()); | 2250 SSLManager::NotifySSLInternalStateChanged( |
| 2251 GetController().GetBrowserContext()); |
| 2250 } | 2252 } |
| 2251 | 2253 |
| 2252 void WebContentsImpl::OnDocumentLoadedInFrame(int64 frame_id) { | 2254 void WebContentsImpl::OnDocumentLoadedInFrame(int64 frame_id) { |
| 2253 controller_.DocumentLoadedInFrame(); | 2255 controller_.DocumentLoadedInFrame(); |
| 2254 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2256 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2255 DocumentLoadedInFrame(frame_id, message_source_)); | 2257 DocumentLoadedInFrame(frame_id, message_source_)); |
| 2256 } | 2258 } |
| 2257 | 2259 |
| 2258 void WebContentsImpl::OnDidFinishLoad( | 2260 void WebContentsImpl::OnDidFinishLoad( |
| 2259 int64 frame_id, | 2261 int64 frame_id, |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2516 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2518 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2517 FrameDetached(message_source_, frame_id)); | 2519 FrameDetached(message_source_, frame_id)); |
| 2518 } | 2520 } |
| 2519 | 2521 |
| 2520 void WebContentsImpl::DidBlock3DAPIs(const GURL& url, | 2522 void WebContentsImpl::DidBlock3DAPIs(const GURL& url, |
| 2521 ThreeDAPIType requester) { | 2523 ThreeDAPIType requester) { |
| 2522 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2524 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2523 DidBlock3DAPIs(url, requester)); | 2525 DidBlock3DAPIs(url, requester)); |
| 2524 } | 2526 } |
| 2525 | 2527 |
| 2528 void WebContentsImpl::DidChangeVisibleSSLState() { |
| 2529 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2530 DidChangeVisibleSSLState()); |
| 2531 } |
| 2532 |
| 2526 // Notifies the RenderWidgetHost instance about the fact that the page is | 2533 // Notifies the RenderWidgetHost instance about the fact that the page is |
| 2527 // loading, or done loading and calls the base implementation. | 2534 // loading, or done loading and calls the base implementation. |
| 2528 void WebContentsImpl::SetIsLoading(bool is_loading, | 2535 void WebContentsImpl::SetIsLoading(bool is_loading, |
| 2529 LoadNotificationDetails* details) { | 2536 LoadNotificationDetails* details) { |
| 2530 if (is_loading == is_loading_) | 2537 if (is_loading == is_loading_) |
| 2531 return; | 2538 return; |
| 2532 | 2539 |
| 2533 if (!is_loading) { | 2540 if (!is_loading) { |
| 2534 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); | 2541 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); |
| 2535 load_state_host_.clear(); | 2542 load_state_host_.clear(); |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3529 | 3536 |
| 3530 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { | 3537 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { |
| 3531 return browser_plugin_guest_.get(); | 3538 return browser_plugin_guest_.get(); |
| 3532 } | 3539 } |
| 3533 | 3540 |
| 3534 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { | 3541 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { |
| 3535 return browser_plugin_embedder_.get(); | 3542 return browser_plugin_embedder_.get(); |
| 3536 } | 3543 } |
| 3537 | 3544 |
| 3538 } // namespace content | 3545 } // namespace content |
| OLD | NEW |