OLD | NEW |
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 "ios/chrome/browser/ssl/ios_ssl_blocking_page.h" | 5 #include "ios/chrome/browser/ssl/ios_ssl_blocking_page.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "components/security_interstitials/core/metrics_helper.h" | 13 #include "components/security_interstitials/core/metrics_helper.h" |
14 #include "components/security_interstitials/core/ssl_error_ui.h" | 14 #include "components/security_interstitials/core/ssl_error_ui.h" |
15 #include "components/strings/grit/components_strings.h" | 15 #include "components/strings/grit/components_strings.h" |
16 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 16 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
17 #include "ios/chrome/browser/interstitials/ios_chrome_controller_client.h" | 17 #include "ios/chrome/browser/interstitials/ios_chrome_controller_client.h" |
18 #include "ios/chrome/browser/interstitials/ios_chrome_metrics_helper.h" | 18 #include "ios/chrome/browser/interstitials/ios_chrome_metrics_helper.h" |
19 #import "ios/web/public/navigation_item.h" | 19 #import "ios/web/public/navigation_item.h" |
20 #include "ios/web/public/ssl_status.h" | 20 #include "ios/web/public/ssl_status.h" |
21 #include "ios/web/public/web_state/web_state.h" | 21 #include "ios/web/public/web_state/web_state.h" |
22 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
25 | 25 |
| 26 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 27 #error "This file requires ARC support." |
| 28 #endif |
| 29 |
26 using security_interstitials::SSLErrorUI; | 30 using security_interstitials::SSLErrorUI; |
27 | 31 |
28 namespace { | 32 namespace { |
29 // Events for UMA. Do not reorder or change! | 33 // Events for UMA. Do not reorder or change! |
30 enum SSLExpirationAndDecision { | 34 enum SSLExpirationAndDecision { |
31 EXPIRED_AND_PROCEED, | 35 EXPIRED_AND_PROCEED, |
32 EXPIRED_AND_DO_NOT_PROCEED, | 36 EXPIRED_AND_DO_NOT_PROCEED, |
33 NOT_EXPIRED_AND_PROCEED, | 37 NOT_EXPIRED_AND_PROCEED, |
34 NOT_EXPIRED_AND_DO_NOT_PROCEED, | 38 NOT_EXPIRED_AND_DO_NOT_PROCEED, |
35 END_OF_SSL_EXPIRATION_AND_DECISION, | 39 END_OF_SSL_EXPIRATION_AND_DECISION, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 195 |
192 callback_.Run(false); | 196 callback_.Run(false); |
193 callback_.Reset(); | 197 callback_.Reset(); |
194 } | 198 } |
195 | 199 |
196 // static | 200 // static |
197 bool IOSSSLBlockingPage::IsOverridable(int options_mask) { | 201 bool IOSSSLBlockingPage::IsOverridable(int options_mask) { |
198 return (options_mask & SSLErrorUI::SOFT_OVERRIDE_ENABLED) && | 202 return (options_mask & SSLErrorUI::SOFT_OVERRIDE_ENABLED) && |
199 !(options_mask & SSLErrorUI::STRICT_ENFORCEMENT); | 203 !(options_mask & SSLErrorUI::STRICT_ENFORCEMENT); |
200 } | 204 } |
OLD | NEW |