Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(904)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 12041059: content: convert SSL notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android build Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 2153
2154 NotificationService::current()->Notify( 2154 NotificationService::current()->Notify(
2155 NOTIFICATION_LOAD_FROM_MEMORY_CACHE, 2155 NOTIFICATION_LOAD_FROM_MEMORY_CACHE,
2156 Source<NavigationController>(&controller_), 2156 Source<NavigationController>(&controller_),
2157 Details<LoadFromMemoryCacheDetails>(&details)); 2157 Details<LoadFromMemoryCacheDetails>(&details));
2158 } 2158 }
2159 2159
2160 void WebContentsImpl::OnDidDisplayInsecureContent() { 2160 void WebContentsImpl::OnDidDisplayInsecureContent() {
2161 RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); 2161 RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent"));
2162 displayed_insecure_content_ = true; 2162 displayed_insecure_content_ = true;
2163 SSLManager::NotifySSLInternalStateChanged(&GetController()); 2163 SSLManager::NotifySSLInternalStateChanged(
2164 GetController().GetBrowserContext());
2164 } 2165 }
2165 2166
2166 void WebContentsImpl::OnDidRunInsecureContent( 2167 void WebContentsImpl::OnDidRunInsecureContent(
2167 const std::string& security_origin, const GURL& target_url) { 2168 const std::string& security_origin, const GURL& target_url) {
2168 LOG(INFO) << security_origin << " ran insecure content from " 2169 LOG(INFO) << security_origin << " ran insecure content from "
2169 << target_url.possibly_invalid_spec(); 2170 << target_url.possibly_invalid_spec();
2170 RecordAction(UserMetricsAction("SSL.RanInsecureContent")); 2171 RecordAction(UserMetricsAction("SSL.RanInsecureContent"));
2171 if (EndsWith(security_origin, kDotGoogleDotCom, false)) 2172 if (EndsWith(security_origin, kDotGoogleDotCom, false))
2172 RecordAction(UserMetricsAction("SSL.RanInsecureContentGoogle")); 2173 RecordAction(UserMetricsAction("SSL.RanInsecureContentGoogle"));
2173 controller_.ssl_manager()->DidRunInsecureContent(security_origin); 2174 controller_.ssl_manager()->DidRunInsecureContent(security_origin);
2174 displayed_insecure_content_ = true; 2175 displayed_insecure_content_ = true;
2175 SSLManager::NotifySSLInternalStateChanged(&GetController()); 2176 SSLManager::NotifySSLInternalStateChanged(
2177 GetController().GetBrowserContext());
2176 } 2178 }
2177 2179
2178 void WebContentsImpl::OnDocumentLoadedInFrame(int64 frame_id) { 2180 void WebContentsImpl::OnDocumentLoadedInFrame(int64 frame_id) {
2179 controller_.DocumentLoadedInFrame(); 2181 controller_.DocumentLoadedInFrame();
2180 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2182 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2181 DocumentLoadedInFrame(frame_id, message_source_)); 2183 DocumentLoadedInFrame(frame_id, message_source_));
2182 } 2184 }
2183 2185
2184 void WebContentsImpl::OnDidFinishLoad( 2186 void WebContentsImpl::OnDidFinishLoad(
2185 int64 frame_id, 2187 int64 frame_id,
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2441 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2440 FrameDetached(message_source_, frame_id)); 2442 FrameDetached(message_source_, frame_id));
2441 } 2443 }
2442 2444
2443 void WebContentsImpl::DidBlock3DAPIs(const GURL& url, 2445 void WebContentsImpl::DidBlock3DAPIs(const GURL& url,
2444 ThreeDAPIType requester) { 2446 ThreeDAPIType requester) {
2445 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2447 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2446 DidBlock3DAPIs(url, requester)); 2448 DidBlock3DAPIs(url, requester));
2447 } 2449 }
2448 2450
2451 void WebContentsImpl::DidChangeVisibleSSLState() {
2452 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2453 DidChangeVisibleSSLState());
2454 }
2455
2449 // Notifies the RenderWidgetHost instance about the fact that the page is 2456 // Notifies the RenderWidgetHost instance about the fact that the page is
2450 // loading, or done loading and calls the base implementation. 2457 // loading, or done loading and calls the base implementation.
2451 void WebContentsImpl::SetIsLoading(bool is_loading, 2458 void WebContentsImpl::SetIsLoading(bool is_loading,
2452 LoadNotificationDetails* details) { 2459 LoadNotificationDetails* details) {
2453 if (is_loading == is_loading_) 2460 if (is_loading == is_loading_)
2454 return; 2461 return;
2455 2462
2456 if (!is_loading) { 2463 if (!is_loading) {
2457 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); 2464 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16());
2458 load_state_host_.clear(); 2465 load_state_host_.clear();
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
3452 3459
3453 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3460 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
3454 return browser_plugin_guest_.get(); 3461 return browser_plugin_guest_.get();
3455 } 3462 }
3456 3463
3457 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3464 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() {
3458 return browser_plugin_embedder_.get(); 3465 return browser_plugin_embedder_.get();
3459 } 3466 }
3460 3467
3461 } // namespace content 3468 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698