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

Side by Side Diff: components/security_interstitials/content/security_interstitial_controller_client.cc

Issue 2858043004: Support interstitials with no primary button (Closed)
Patch Set: Fix iOS CanGoBack implementation Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/security_interstitials/content/security_interstitial_contro ller_client.h" 5 #include "components/security_interstitials/content/security_interstitial_contro ller_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "components/prefs/pref_service.h" 9 #include "components/prefs/pref_service.h"
10 #include "components/safe_browsing_db/safe_browsing_prefs.h" 10 #include "components/safe_browsing_db/safe_browsing_prefs.h"
(...skipping 28 matching lines...) Expand all
39 39
40 content::InterstitialPage* 40 content::InterstitialPage*
41 SecurityInterstitialControllerClient::interstitial_page() { 41 SecurityInterstitialControllerClient::interstitial_page() {
42 return interstitial_page_; 42 return interstitial_page_;
43 } 43 }
44 44
45 void SecurityInterstitialControllerClient::GoBack() { 45 void SecurityInterstitialControllerClient::GoBack() {
46 interstitial_page_->DontProceed(); 46 interstitial_page_->DontProceed();
47 } 47 }
48 48
49 bool SecurityInterstitialControllerClient::CanGoBack() {
50 return web_contents_->GetController().CanGoBack();
51 }
52
49 void SecurityInterstitialControllerClient::GoBackAfterNavigationCommitted() { 53 void SecurityInterstitialControllerClient::GoBackAfterNavigationCommitted() {
50 // If the offending entry has committed, go back or to a safe page without 54 // If the offending entry has committed, go back or to a safe page without
51 // closing the error page. This error page will be closed when the new page 55 // closing the error page. This error page will be closed when the new page
52 // commits. 56 // commits.
53 if (web_contents_->GetController().CanGoBack()) { 57 if (web_contents_->GetController().CanGoBack()) {
54 web_contents_->GetController().GoBack(); 58 web_contents_->GetController().GoBack();
55 } else { 59 } else {
56 web_contents_->GetController().LoadURL( 60 web_contents_->GetController().LoadURL(
57 default_safe_page_, content::Referrer(), 61 default_safe_page_, content::Referrer(),
58 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); 62 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string());
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 bool SecurityInterstitialControllerClient::CanLaunchDateAndTimeSettings() { 97 bool SecurityInterstitialControllerClient::CanLaunchDateAndTimeSettings() {
94 NOTREACHED(); 98 NOTREACHED();
95 return false; 99 return false;
96 } 100 }
97 101
98 void SecurityInterstitialControllerClient::LaunchDateAndTimeSettings() { 102 void SecurityInterstitialControllerClient::LaunchDateAndTimeSettings() {
99 NOTREACHED(); 103 NOTREACHED();
100 } 104 }
101 105
102 } // namespace security_interstitials 106 } // namespace security_interstitials
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698