| 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 "ios/chrome/browser/interstitials/ios_security_interstitial_page.h" | 5 #include "ios/chrome/browser/interstitials/ios_security_interstitial_page.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "components/grit/components_resources.h" | 8 #include "components/grit/components_resources.h" |
| 9 #include "components/prefs/pref_service.h" | 9 #include "components/prefs/pref_service.h" |
| 10 #include "components/security_interstitials/core/common_string_util.h" | 10 #include "components/security_interstitials/core/common_string_util.h" |
| 11 #include "components/security_interstitials/core/metrics_helper.h" | |
| 12 #include "ios/chrome/browser/application_context.h" | 11 #include "ios/chrome/browser/application_context.h" |
| 13 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 12 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 14 #include "ios/chrome/browser/interstitials/ios_chrome_controller_client.h" | |
| 15 #include "ios/chrome/browser/pref_names.h" | 13 #include "ios/chrome/browser/pref_names.h" |
| 16 #include "ios/web/public/interstitials/web_interstitial.h" | 14 #include "ios/web/public/interstitials/web_interstitial.h" |
| 17 #include "ios/web/public/web_state/web_state.h" | 15 #include "ios/web/public/web_state/web_state.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/base/webui/jstemplate_builder.h" | 17 #include "ui/base/webui/jstemplate_builder.h" |
| 20 #include "ui/base/webui/web_ui_util.h" | 18 #include "ui/base/webui/web_ui_util.h" |
| 21 | 19 |
| 22 IOSSecurityInterstitialPage::IOSSecurityInterstitialPage( | 20 IOSSecurityInterstitialPage::IOSSecurityInterstitialPage( |
| 23 web::WebState* web_state, | 21 web::WebState* web_state, |
| 24 const GURL& request_url) | 22 const GURL& request_url) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 55 base::string16 IOSSecurityInterstitialPage::GetFormattedHostName() const { | 53 base::string16 IOSSecurityInterstitialPage::GetFormattedHostName() const { |
| 56 return security_interstitials::common_string_util::GetFormattedHostName( | 54 return security_interstitials::common_string_util::GetFormattedHostName( |
| 57 request_url_); | 55 request_url_); |
| 58 } | 56 } |
| 59 | 57 |
| 60 bool IOSSecurityInterstitialPage::IsPrefEnabled(const char* pref_name) const { | 58 bool IOSSecurityInterstitialPage::IsPrefEnabled(const char* pref_name) const { |
| 61 ios::ChromeBrowserState* browser_state = | 59 ios::ChromeBrowserState* browser_state = |
| 62 ios::ChromeBrowserState::FromBrowserState(web_state_->GetBrowserState()); | 60 ios::ChromeBrowserState::FromBrowserState(web_state_->GetBrowserState()); |
| 63 return browser_state->GetPrefs()->GetBoolean(pref_name); | 61 return browser_state->GetPrefs()->GetBoolean(pref_name); |
| 64 } | 62 } |
| OLD | NEW |