| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 ~ChromeSecurityStateModelClient() override; | 30 ~ChromeSecurityStateModelClient() override; |
| 31 | 31 |
| 32 void GetSecurityInfo( | 32 void GetSecurityInfo( |
| 33 security_state::SecurityStateModel::SecurityInfo* result) const; | 33 security_state::SecurityStateModel::SecurityInfo* result) const; |
| 34 | 34 |
| 35 // Called when the NavigationEntry's SSLStatus or other security | 35 // Called when the NavigationEntry's SSLStatus or other security |
| 36 // information changes. | 36 // information changes. |
| 37 void VisibleSecurityStateChanged(); | 37 void VisibleSecurityStateChanged(); |
| 38 | 38 |
| 39 // content::WebContentsObserver: | 39 // content::WebContentsObserver: |
| 40 void DidStartNavigation( |
| 41 content::NavigationHandle* navigation_handle) override; |
| 40 void DidFinishNavigation( | 42 void DidFinishNavigation( |
| 41 content::NavigationHandle* navigation_handle) override; | 43 content::NavigationHandle* navigation_handle) override; |
| 44 void WebContentsDestroyed() override; |
| 42 | 45 |
| 43 // Returns the SecurityStyle that should be applied to a WebContents | 46 // Returns the SecurityStyle that should be applied to a WebContents |
| 44 // with the given |security_info|. Populates | 47 // with the given |security_info|. Populates |
| 45 // |security_style_explanations| to explain why the returned | 48 // |security_style_explanations| to explain why the returned |
| 46 // SecurityStyle was chosen. | 49 // SecurityStyle was chosen. |
| 47 static blink::WebSecurityStyle GetSecurityStyle( | 50 static blink::WebSecurityStyle GetSecurityStyle( |
| 48 const security_state::SecurityStateModel::SecurityInfo& security_info, | 51 const security_state::SecurityStateModel::SecurityInfo& security_info, |
| 49 content::SecurityStyleExplanations* security_style_explanations); | 52 content::SecurityStyleExplanations* security_style_explanations); |
| 50 | 53 |
| 51 // SecurityStateModelClient: | 54 // SecurityStateModelClient: |
| 52 void GetVisibleSecurityState( | 55 void GetVisibleSecurityState( |
| 53 security_state::SecurityStateModel::VisibleSecurityState* state) override; | 56 security_state::SecurityStateModel::VisibleSecurityState* state) override; |
| 54 bool UsedPolicyInstalledCertificate() override; | 57 bool UsedPolicyInstalledCertificate() override; |
| 55 bool IsOriginSecure(const GURL& url) override; | 58 bool IsOriginSecure(const GURL& url) override; |
| 56 | 59 |
| 57 private: | 60 private: |
| 58 explicit ChromeSecurityStateModelClient(content::WebContents* web_contents); | 61 explicit ChromeSecurityStateModelClient(content::WebContents* web_contents); |
| 59 friend class content::WebContentsUserData<ChromeSecurityStateModelClient>; | 62 friend class content::WebContentsUserData<ChromeSecurityStateModelClient>; |
| 60 | 63 |
| 61 content::WebContents* web_contents_; | 64 content::WebContents* web_contents_; |
| 62 std::unique_ptr<security_state::SecurityStateModel> security_state_model_; | 65 std::unique_ptr<security_state::SecurityStateModel> security_state_model_; |
| 63 | 66 |
| 64 // True if a console has been logged about an omnibox warning that | 67 // True if a console has been logged about an omnibox warning that |
| 65 // will be shown in future versions of Chrome for insecure HTTP | 68 // will be shown in future versions of Chrome for insecure HTTP |
| 66 // pages. This message should only be logged once per main-frame | 69 // pages. This message should only be logged once per main-frame |
| 67 // navigation. | 70 // navigation. |
| 68 bool logged_http_warning_on_current_navigation_; | 71 bool logged_http_warning_on_current_navigation_; |
| 69 | 72 |
| 73 // The time that a console or omnibox warning was shown for insecure |
| 74 // HTTP pages that contain password or credit card fields. This is set |
| 75 // at most once per main-frame navigation (the first that an HTTP |
| 76 // warning triggers on that navigation) and is used for UMA |
| 77 // histogramming. |
| 78 base::Time time_of_http_warning_on_current_navigation_; |
| 79 |
| 70 DISALLOW_COPY_AND_ASSIGN(ChromeSecurityStateModelClient); | 80 DISALLOW_COPY_AND_ASSIGN(ChromeSecurityStateModelClient); |
| 71 }; | 81 }; |
| 72 | 82 |
| 73 #endif // CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_CLIENT_H_ | 83 #endif // CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_CLIENT_H_ |
| OLD | NEW |