Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: chrome/browser/ssl/security_state_tab_helper.h

Issue 2448943002: Refactor SecurityStateModel/Clients for simplicity and reusability. (Closed)
Patch Set: fix DEPS. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_SECURITY_STATE_TAB_HELPER_H_
6 #define CHROME_BROWSER_SSL_SECURITY_STATE_TAB_HELPER_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "content/public/browser/web_contents_observer.h"
12 #include "content/public/browser/web_contents_user_data.h"
13 #include "third_party/WebKit/public/platform/WebSecurityStyle.h"
14
15 namespace content {
16 struct SecurityStyleExplanations;
17 class NavigationHandle;
18 class WebContents;
19 } // namespace content
20
21 namespace security_state {
22 struct SecurityInfo;
23 struct VisibleSecurityState;
24 } // namespace security_state
25
26 // Tab helper provides the page's security status. Also logs console warnings
27 // for private data on insecure pages.
28 class SecurityStateTabHelper
29 : public content::WebContentsObserver,
30 public content::WebContentsUserData<SecurityStateTabHelper> {
31 public:
32 ~SecurityStateTabHelper() override;
33
34 // See security_state::GetSecurityInfo.
35 void GetSecurityInfo(
36 security_state::SecurityInfo* result) const;
37
38 // Called when the NavigationEntry's SSLStatus or other security
39 // information changes.
40 void VisibleSecurityStateChanged();
41
42 // content::WebContentsObserver:
43 void DidFinishNavigation(
44 content::NavigationHandle* navigation_handle) override;
45
46 private:
47 explicit SecurityStateTabHelper(content::WebContents* web_contents);
48 friend class content::WebContentsUserData<SecurityStateTabHelper>;
49
50 bool UsedPolicyInstalledCertificate() const;
51 bool GetMalwareStatus() const;
52 std::unique_ptr<security_state::VisibleSecurityState>
53 GetVisibleSecurityState() const;
54
55 // True if a console message has been logged about an omnibox warning that
56 // will be shown in future versions of Chrome for insecure HTTP pages. This
57 // message should only be logged once per main-frame navigation.
58 bool logged_http_warning_on_current_navigation_;
59
60 DISALLOW_COPY_AND_ASSIGN(SecurityStateTabHelper);
61 };
62
63 #endif // CHROME_BROWSER_SSL_SECURITY_STATE_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698