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

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

Issue 2225343002: Navigation: move RestoreType and ReloadType into a separate file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [rebase] Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_error_handler.h" 5 #include "chrome/browser/ssl/ssl_error_handler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 content::Details<CaptivePortalService::Results>(details).ptr(); 387 content::Details<CaptivePortalService::Results>(details).ptr();
388 if (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL) 388 if (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL)
389 ShowCaptivePortalInterstitial(results->landing_url); 389 ShowCaptivePortalInterstitial(results->landing_url);
390 else 390 else
391 ShowSSLInterstitial(); 391 ShowSSLInterstitial();
392 #endif 392 #endif
393 } 393 }
394 394
395 void SSLErrorHandler::DidStartNavigationToPendingEntry( 395 void SSLErrorHandler::DidStartNavigationToPendingEntry(
396 const GURL& /* url */, 396 const GURL& /* url */,
397 content::NavigationController::ReloadType /* reload_type */) { 397 content::ReloadType /* reload_type */) {
398 // Destroy the error handler on all new navigations. This ensures that the 398 // Destroy the error handler on all new navigations. This ensures that the
399 // handler is properly recreated when a hanging page is navigated to an SSL 399 // handler is properly recreated when a hanging page is navigated to an SSL
400 // error, even when the tab's WebContents doesn't change. 400 // error, even when the tab's WebContents doesn't change.
401 DeleteSSLErrorHandler(); 401 DeleteSSLErrorHandler();
402 } 402 }
403 403
404 void SSLErrorHandler::NavigationStopped() { 404 void SSLErrorHandler::NavigationStopped() {
405 // Destroy the error handler when the page load is stopped. 405 // Destroy the error handler when the page load is stopped.
406 DeleteSSLErrorHandler(); 406 DeleteSSLErrorHandler();
407 } 407 }
408 408
409 void SSLErrorHandler::DeleteSSLErrorHandler() { 409 void SSLErrorHandler::DeleteSSLErrorHandler() {
410 // Need to explicity deny the certificate via the callback, otherwise memory 410 // Need to explicity deny the certificate via the callback, otherwise memory
411 // is leaked. 411 // is leaked.
412 if (!callback_.is_null()) { 412 if (!callback_.is_null()) {
413 base::ResetAndReturn(&callback_) 413 base::ResetAndReturn(&callback_)
414 .Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY); 414 .Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY);
415 } 415 }
416 if (common_name_mismatch_handler_) { 416 if (common_name_mismatch_handler_) {
417 common_name_mismatch_handler_->Cancel(); 417 common_name_mismatch_handler_->Cancel();
418 common_name_mismatch_handler_.reset(); 418 common_name_mismatch_handler_.reset();
419 } 419 }
420 // Deletes |this| and also destroys the timer. 420 // Deletes |this| and also destroys the timer.
421 web_contents_->RemoveUserData(UserDataKey()); 421 web_contents_->RemoveUserData(UserDataKey());
422 } 422 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_error_handler.h ('k') | chrome/browser/ui/android/tab_model/android_live_tab_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698