| 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 #ifndef CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_CLIENT_H_ |
| 6 #define CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_CLIENT_H_ | 6 #define CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/ssl/security_state_model.h" | 9 #include "components/security_state/security_state_model.h" |
| 10 #include "chrome/browser/ssl/security_state_model_client.h" | 10 #include "components/security_state/security_state_model_client.h" |
| 11 #include "content/public/browser/web_contents_user_data.h" | 11 #include "content/public/browser/web_contents_user_data.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class WebContents; | 14 class WebContents; |
| 15 } // namespace content | 15 } // namespace content |
| 16 | 16 |
| 17 // Uses a WebContents to provide a SecurityStateModel with the | 17 // Uses a WebContents to provide a SecurityStateModel with the |
| 18 // information that it needs to determine the page's security status. | 18 // information that it needs to determine the page's security status. |
| 19 class ChromeSecurityStateModelClient | 19 class ChromeSecurityStateModelClient |
| 20 : public SecurityStateModelClient, | 20 : public security_state::SecurityStateModelClient, |
| 21 public content::WebContentsUserData<ChromeSecurityStateModelClient> { | 21 public content::WebContentsUserData<ChromeSecurityStateModelClient> { |
| 22 public: | 22 public: |
| 23 ~ChromeSecurityStateModelClient() override; | 23 ~ChromeSecurityStateModelClient() override; |
| 24 | 24 |
| 25 const SecurityStateModel::SecurityInfo& GetSecurityInfo() const; | 25 const security_state::SecurityStateModel::SecurityInfo& GetSecurityInfo() |
| 26 const; |
| 26 | 27 |
| 27 // SecurityStateModelClient: | 28 // SecurityStateModelClient: |
| 28 void GetVisibleSecurityState( | 29 void GetVisibleSecurityState( |
| 29 SecurityStateModel::VisibleSecurityState* state) override; | 30 security_state::SecurityStateModel::VisibleSecurityState* state) override; |
| 30 bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) override; | 31 bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) override; |
| 31 bool UsedPolicyInstalledCertificate() override; | 32 bool UsedPolicyInstalledCertificate() override; |
| 32 bool IsOriginSecure(const GURL& url) override; | 33 bool IsOriginSecure(const GURL& url) override; |
| 33 | 34 |
| 34 private: | 35 private: |
| 35 explicit ChromeSecurityStateModelClient(content::WebContents* web_contents); | 36 explicit ChromeSecurityStateModelClient(content::WebContents* web_contents); |
| 36 friend class content::WebContentsUserData<ChromeSecurityStateModelClient>; | 37 friend class content::WebContentsUserData<ChromeSecurityStateModelClient>; |
| 37 | 38 |
| 38 content::WebContents* web_contents_; | 39 content::WebContents* web_contents_; |
| 39 scoped_ptr<SecurityStateModel> security_state_model_; | 40 scoped_ptr<security_state::SecurityStateModel> security_state_model_; |
| 40 | 41 |
| 41 DISALLOW_COPY_AND_ASSIGN(ChromeSecurityStateModelClient); | 42 DISALLOW_COPY_AND_ASSIGN(ChromeSecurityStateModelClient); |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 #endif // CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_CLIENT_H_ | 45 #endif // CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_CLIENT_H_ |
| OLD | NEW |