| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_H_ |
| 6 #define CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/macros.h" |
| 12 #include "components/security_state/content/web_contents_security_state_model.h" |
| 13 #include "components/security_state/core/security_state_model.h" |
| 14 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "content/public/browser/web_contents_user_data.h" |
| 16 #include "third_party/WebKit/public/platform/WebSecurityStyle.h" |
| 17 |
| 18 namespace content { |
| 19 struct SecurityStyleExplanations; |
| 20 class NavigationEntry; |
| 21 class NavigationHandle; |
| 22 class WebContents; |
| 23 } // namespace content |
| 24 |
| 25 // Provides a WebContentsSecurityStateModel with chrome-specific information |
| 26 // that it needs to determine the page's security status. |
| 27 class ChromeSecurityStateModel |
| 28 : public content::WebContentsObserver, |
| 29 public content::WebContentsUserData<ChromeSecurityStateModel> { |
| 30 public: |
| 31 ~ChromeSecurityStateModel() override; |
| 32 |
| 33 // See WebContentsSecurityStateModel::GetSecurityInfo. |
| 34 void GetSecurityInfo( |
| 35 security_state::SecurityStateModel::SecurityInfo* result) const; |
| 36 |
| 37 // Called when the NavigationEntry's SSLStatus changes. |
| 38 void VisibleSSLStateChanged(); |
| 39 |
| 40 // content::WebContentsObserver: |
| 41 void DidFinishNavigation( |
| 42 content::NavigationHandle* navigation_handle) override; |
| 43 |
| 44 private: |
| 45 explicit ChromeSecurityStateModel(content::WebContents* web_contents); |
| 46 friend class content::WebContentsUserData<ChromeSecurityStateModel>; |
| 47 |
| 48 // For web_contents_model_. |
| 49 FRIEND_TEST_ALL_PREFIXES(ChromeSecurityStateModelTest, |
| 50 VisibleSecurityStateNonsecureFormInputs); |
| 51 |
| 52 bool UsedPolicyInstalledCertificate() const; |
| 53 bool GetMalwareStatus() const; |
| 54 |
| 55 std::unique_ptr<security_state::WebContentsSecurityStateModel> |
| 56 web_contents_model_; |
| 57 |
| 58 // True if a console has been logged about an omnibox warning that |
| 59 // will be shown in future versions of Chrome for insecure HTTP |
| 60 // pages. This message should only be logged once per main-frame |
| 61 // navigation. |
| 62 bool logged_http_warning_on_current_navigation_; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(ChromeSecurityStateModel); |
| 65 }; |
| 66 |
| 67 #endif // CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_H_ |
| OLD | NEW |