| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bad_clock_blocking_page.h" | 5 #include "chrome/browser/ssl/bad_clock_blocking_page.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 BadClockBlockingPage::BadClockBlockingPage( | 53 BadClockBlockingPage::BadClockBlockingPage( |
| 54 content::WebContents* web_contents, | 54 content::WebContents* web_contents, |
| 55 int cert_error, | 55 int cert_error, |
| 56 const net::SSLInfo& ssl_info, | 56 const net::SSLInfo& ssl_info, |
| 57 const GURL& request_url, | 57 const GURL& request_url, |
| 58 const base::Time& time_triggered, | 58 const base::Time& time_triggered, |
| 59 scoped_ptr<SSLCertReporter> ssl_cert_reporter, | 59 scoped_ptr<SSLCertReporter> ssl_cert_reporter, |
| 60 const base::Callback<void(bool)>& callback) | 60 const base::Callback<void(bool)>& callback) |
| 61 : SecurityInterstitialPage(web_contents, request_url), | 61 : SecurityInterstitialPage(web_contents, request_url), |
| 62 callback_(callback), | 62 callback_(callback), |
| 63 cert_error_(cert_error), | |
| 64 ssl_info_(ssl_info), | 63 ssl_info_(ssl_info), |
| 65 time_triggered_(time_triggered), | 64 time_triggered_(time_triggered), |
| 66 controller_(new ChromeControllerClient(web_contents)) { | 65 controller_(new ChromeControllerClient(web_contents)) { |
| 67 // Get the language for the BadClockUI. | 66 // Get the language for the BadClockUI. |
| 68 std::string languages; | 67 std::string languages; |
| 69 Profile* profile = | 68 Profile* profile = |
| 70 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 69 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 71 if (profile) | 70 if (profile) |
| 72 languages = profile->GetPrefs()->GetString(prefs::kAcceptLanguages); | 71 languages = profile->GetPrefs()->GetString(prefs::kAcceptLanguages); |
| 73 | 72 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 175 |
| 177 void BadClockBlockingPage::NotifyDenyCertificate() { | 176 void BadClockBlockingPage::NotifyDenyCertificate() { |
| 178 // It's possible that callback_ may not exist if the user clicks "Proceed" | 177 // It's possible that callback_ may not exist if the user clicks "Proceed" |
| 179 // followed by pressing the back button before the interstitial is hidden. | 178 // followed by pressing the back button before the interstitial is hidden. |
| 180 // In that case the certificate will still be treated as allowed. | 179 // In that case the certificate will still be treated as allowed. |
| 181 if (callback_.is_null()) | 180 if (callback_.is_null()) |
| 182 return; | 181 return; |
| 183 | 182 |
| 184 base::ResetAndReturn(&callback_).Run(false); | 183 base::ResetAndReturn(&callback_).Run(false); |
| 185 } | 184 } |
| OLD | NEW |