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

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

Issue 12220100: Revert "content: convert SSL notifications to observer usage" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 2197
2198 NotificationService::current()->Notify( 2198 NotificationService::current()->Notify(
2199 NOTIFICATION_LOAD_FROM_MEMORY_CACHE, 2199 NOTIFICATION_LOAD_FROM_MEMORY_CACHE,
2200 Source<NavigationController>(&controller_), 2200 Source<NavigationController>(&controller_),
2201 Details<LoadFromMemoryCacheDetails>(&details)); 2201 Details<LoadFromMemoryCacheDetails>(&details));
2202 } 2202 }
2203 2203
2204 void WebContentsImpl::OnDidDisplayInsecureContent() { 2204 void WebContentsImpl::OnDidDisplayInsecureContent() {
2205 RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); 2205 RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent"));
2206 displayed_insecure_content_ = true; 2206 displayed_insecure_content_ = true;
2207 SSLManager::NotifySSLInternalStateChanged( 2207 SSLManager::NotifySSLInternalStateChanged(&GetController());
2208 GetController().GetBrowserContext());
2209 } 2208 }
2210 2209
2211 void WebContentsImpl::OnDidRunInsecureContent( 2210 void WebContentsImpl::OnDidRunInsecureContent(
2212 const std::string& security_origin, const GURL& target_url) { 2211 const std::string& security_origin, const GURL& target_url) {
2213 LOG(INFO) << security_origin << " ran insecure content from " 2212 LOG(INFO) << security_origin << " ran insecure content from "
2214 << target_url.possibly_invalid_spec(); 2213 << target_url.possibly_invalid_spec();
2215 RecordAction(UserMetricsAction("SSL.RanInsecureContent")); 2214 RecordAction(UserMetricsAction("SSL.RanInsecureContent"));
2216 if (EndsWith(security_origin, kDotGoogleDotCom, false)) 2215 if (EndsWith(security_origin, kDotGoogleDotCom, false))
2217 RecordAction(UserMetricsAction("SSL.RanInsecureContentGoogle")); 2216 RecordAction(UserMetricsAction("SSL.RanInsecureContentGoogle"));
2218 controller_.ssl_manager()->DidRunInsecureContent(security_origin); 2217 controller_.ssl_manager()->DidRunInsecureContent(security_origin);
2219 displayed_insecure_content_ = true; 2218 displayed_insecure_content_ = true;
2220 SSLManager::NotifySSLInternalStateChanged( 2219 SSLManager::NotifySSLInternalStateChanged(&GetController());
2221 GetController().GetBrowserContext());
2222 } 2220 }
2223 2221
2224 void WebContentsImpl::OnDocumentLoadedInFrame(int64 frame_id) { 2222 void WebContentsImpl::OnDocumentLoadedInFrame(int64 frame_id) {
2225 controller_.DocumentLoadedInFrame(); 2223 controller_.DocumentLoadedInFrame();
2226 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2224 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2227 DocumentLoadedInFrame(frame_id, message_source_)); 2225 DocumentLoadedInFrame(frame_id, message_source_));
2228 } 2226 }
2229 2227
2230 void WebContentsImpl::OnDidFinishLoad( 2228 void WebContentsImpl::OnDidFinishLoad(
2231 int64 frame_id, 2229 int64 frame_id,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2486 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2489 FrameDetached(message_source_, frame_id)); 2487 FrameDetached(message_source_, frame_id));
2490 } 2488 }
2491 2489
2492 void WebContentsImpl::DidBlock3DAPIs(const GURL& url, 2490 void WebContentsImpl::DidBlock3DAPIs(const GURL& url,
2493 ThreeDAPIType requester) { 2491 ThreeDAPIType requester) {
2494 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2492 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2495 DidBlock3DAPIs(url, requester)); 2493 DidBlock3DAPIs(url, requester));
2496 } 2494 }
2497 2495
2498 void WebContentsImpl::DidChangeVisibleSSLState() {
2499 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2500 DidChangeVisibleSSLState());
2501 }
2502
2503 // Notifies the RenderWidgetHost instance about the fact that the page is 2496 // Notifies the RenderWidgetHost instance about the fact that the page is
2504 // loading, or done loading and calls the base implementation. 2497 // loading, or done loading and calls the base implementation.
2505 void WebContentsImpl::SetIsLoading(bool is_loading, 2498 void WebContentsImpl::SetIsLoading(bool is_loading,
2506 LoadNotificationDetails* details) { 2499 LoadNotificationDetails* details) {
2507 if (is_loading == is_loading_) 2500 if (is_loading == is_loading_)
2508 return; 2501 return;
2509 2502
2510 if (!is_loading) { 2503 if (!is_loading) {
2511 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); 2504 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16());
2512 load_state_host_.clear(); 2505 load_state_host_.clear();
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
3506 3499
3507 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { 3500 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const {
3508 return browser_plugin_guest_.get(); 3501 return browser_plugin_guest_.get();
3509 } 3502 }
3510 3503
3511 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { 3504 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const {
3512 return browser_plugin_embedder_.get(); 3505 return browser_plugin_embedder_.get();
3513 } 3506 }
3514 3507
3515 } // namespace content 3508 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698