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

Side by Side Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 368143002: Add a chrome://interstitials page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Too many constructors Created 6 years, 5 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 "chrome/browser/ssl/ssl_blocking_page.h" 5 #include "chrome/browser/ssl/ssl_blocking_page.h"
6 6
7 #include "base/build_time.h" 7 #include "base/build_time.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 RecordSSLInterstitialCause(overridable, CLOCK_FUTURE); 253 RecordSSLInterstitialCause(overridable, CLOCK_FUTURE);
254 return false; 254 return false;
255 } 255 }
256 256
257 } // namespace 257 } // namespace
258 258
259 // Note that we always create a navigation entry with SSL errors. 259 // Note that we always create a navigation entry with SSL errors.
260 // No error happening loading a sub-resource triggers an interstitial so far. 260 // No error happening loading a sub-resource triggers an interstitial so far.
261 SSLBlockingPage::SSLBlockingPage( 261 SSLBlockingPage::SSLBlockingPage(
262 content::WebContents* web_contents, 262 content::WebContents* web_contents,
263 bool create_interstitial,
263 int cert_error, 264 int cert_error,
264 const net::SSLInfo& ssl_info, 265 const net::SSLInfo& ssl_info,
265 const GURL& request_url, 266 const GURL& request_url,
266 bool overridable, 267 bool overridable,
267 bool strict_enforcement, 268 bool strict_enforcement,
268 const base::Callback<void(bool)>& callback) 269 const base::Callback<void(bool)>& callback)
269 : callback_(callback), 270 : callback_(callback),
270 web_contents_(web_contents), 271 web_contents_(web_contents),
271 cert_error_(cert_error), 272 cert_error_(cert_error),
272 ssl_info_(ssl_info), 273 ssl_info_(ssl_info),
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 305 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
305 CaptivePortalService* captive_portal_service = 306 CaptivePortalService* captive_portal_service =
306 CaptivePortalServiceFactory::GetForProfile(profile); 307 CaptivePortalServiceFactory::GetForProfile(profile);
307 captive_portal_detection_enabled_ = captive_portal_service ->enabled(); 308 captive_portal_detection_enabled_ = captive_portal_service ->enabled();
308 captive_portal_service ->DetectCaptivePortal(); 309 captive_portal_service ->DetectCaptivePortal();
309 registrar_.Add(this, 310 registrar_.Add(this,
310 chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT, 311 chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT,
311 content::Source<Profile>(profile)); 312 content::Source<Profile>(profile));
312 #endif 313 #endif
313 314
314 interstitial_page_ = InterstitialPage::Create( 315 if (create_interstitial) {
felt 2014/07/15 01:35:07 can you add a comment here explaining what this is
meacer 2014/07/15 19:48:06 Done.
315 web_contents_, true, request_url, this); 316 interstitial_page_ = InterstitialPage::Create(
316 interstitial_page_->Show(); 317 web_contents_, true, request_url, this);
318 interstitial_page_->Show();
319 }
317 } 320 }
318 321
319 SSLBlockingPage::~SSLBlockingPage() { 322 SSLBlockingPage::~SSLBlockingPage() {
320 if (!callback_.is_null()) { 323 if (!callback_.is_null()) {
321 RecordSSLBlockingPageDetailedStats(false, 324 RecordSSLBlockingPageDetailedStats(false,
322 cert_error_, 325 cert_error_,
323 overridable_ && !strict_enforcement_, 326 overridable_ && !strict_enforcement_,
324 internal_, 327 internal_,
325 num_visits_, 328 num_visits_,
326 captive_portal_detection_enabled_, 329 captive_portal_detection_enabled_,
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 // sure we don't clear the captive portal flag, since the interstitial was 756 // sure we don't clear the captive portal flag, since the interstitial was
754 // potentially caused by the captive portal. 757 // potentially caused by the captive portal.
755 captive_portal_detected_ = captive_portal_detected_ || 758 captive_portal_detected_ = captive_portal_detected_ ||
756 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); 759 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL);
757 // Also keep track of non-HTTP portals and error cases. 760 // Also keep track of non-HTTP portals and error cases.
758 captive_portal_no_response_ = captive_portal_no_response_ || 761 captive_portal_no_response_ = captive_portal_no_response_ ||
759 (results->result == captive_portal::RESULT_NO_RESPONSE); 762 (results->result == captive_portal::RESULT_NO_RESPONSE);
760 } 763 }
761 #endif 764 #endif
762 } 765 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698