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