Chromium Code Reviews| 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 COMPONENTS_SECURITY_STATE_CONTENT_WEB_CONTENTS_SECURITY_STATE_MODEL_CLIE NT_H_ | |
| 6 #define COMPONENTS_SECURITY_STATE_CONTENT_WEB_CONTENTS_SECURITY_STATE_MODEL_CLIE NT_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "components/security_state/core/security_state_model.h" | |
| 12 #include "components/security_state/core/security_state_model_client.h" | |
| 13 #include "third_party/WebKit/public/platform/WebSecurityStyle.h" | |
| 14 | |
| 15 namespace content { | |
| 16 class NavigationEntry; | |
| 17 struct SecurityStyleExplanations; | |
| 18 class WebContents; | |
| 19 } | |
| 20 | |
| 21 namespace security_state { | |
| 22 | |
| 23 // Uses a WebContents to provide a SecurityStateModel with the | |
| 24 // information that it needs to determine the page's security status. | |
| 25 class WebContentsSecurityStateModelClient : public SecurityStateModelClient { | |
|
blundell
2016/10/25 16:24:01
drive-by nit: The Client naming signifies an inter
Eric Seckler
2016/10/25 16:43:58
security_state/content/ basically is the content i
| |
| 26 public: | |
| 27 explicit WebContentsSecurityStateModelClient( | |
| 28 content::WebContents* web_contents); | |
| 29 ~WebContentsSecurityStateModelClient() override; | |
| 30 | |
| 31 void GetSecurityInfo(SecurityStateModel::SecurityInfo* result) const; | |
| 32 | |
| 33 // Returns the SecurityStyle that should be applied to a WebContents | |
| 34 // with the given |security_info|. Populates | |
| 35 // |security_style_explanations| to explain why the returned | |
| 36 // SecurityStyle was chosen. | |
| 37 static blink::WebSecurityStyle GetSecurityStyle( | |
| 38 const SecurityStateModel::SecurityInfo& security_info, | |
| 39 content::SecurityStyleExplanations* security_style_explanations); | |
| 40 | |
| 41 // SecurityStateModelClient: | |
| 42 void GetVisibleSecurityState( | |
| 43 SecurityStateModel::VisibleSecurityState* state) override; | |
| 44 bool UsedPolicyInstalledCertificate() override; | |
| 45 bool IsOriginSecure(const GURL& url) override; | |
| 46 | |
| 47 protected: | |
| 48 virtual void CheckMalwareStatus( | |
| 49 content::NavigationEntry* entry, | |
| 50 content::WebContents* web_contents, | |
| 51 SecurityStateModel::VisibleSecurityState* state) = 0; | |
| 52 | |
| 53 private: | |
| 54 content::WebContents* web_contents_; | |
| 55 std::unique_ptr<SecurityStateModel> security_state_model_; | |
| 56 | |
| 57 DISALLOW_COPY_AND_ASSIGN(WebContentsSecurityStateModelClient); | |
| 58 }; | |
| 59 | |
| 60 } // namespace security_state | |
| 61 | |
| 62 #endif // COMPONENTS_SECURITY_STATE_CONTENT_WEB_CONTENTS_SECURITY_STATE_MODEL_C LIENT_H_ | |
| OLD | NEW |