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

Unified Diff: chrome/browser/ssl/security_state_model.h

Issue 1473523002: Switch SecurityStateModel ownership to ChromeSecurityStateModelClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delegate -> client Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ssl/security_state_model.h
diff --git a/chrome/browser/ssl/security_state_model.h b/chrome/browser/ssl/security_state_model.h
index 022435c8fdc9497fc9f953d7294eb041a978dc21..0b0b2a1c38aaec2f5c499d3eb3f8fba338e8930c 100644
--- a/chrome/browser/ssl/security_state_model.h
+++ b/chrome/browser/ssl/security_state_model.h
@@ -22,16 +22,14 @@ class Profile;
class SecurityStateModelClient;
// SecurityStateModel provides high-level security information about a
-// page or request. It is attached to a WebContents and will provide the
-// security info for that WebContents.
+// page or request.
//
// SecurityStateModel::SecurityInfo is the main data structure computed
// by a SecurityStateModel. SecurityInfo contains a SecurityLevel (which
// is a single value describing the overall security state) along with
// information that a consumer might want to display in UI to explain or
// elaborate on the SecurityLevel.
-class SecurityStateModel
- : public content::WebContentsUserData<SecurityStateModel> {
+class SecurityStateModel {
public:
// Describes the overall security state of the page.
//
@@ -124,13 +122,16 @@ class SecurityStateModel
static const content::SecurityStyle kDisplayedInsecureContentStyle;
static const content::SecurityStyle kRanInsecureContentStyle;
- ~SecurityStateModel() override;
+ explicit SecurityStateModel(content::WebContents* web_contents);
+ virtual ~SecurityStateModel();
// Returns a SecurityInfo describing the current page. Results are
// cached so that computation is only done once per visible
// NavigationEntry.
const SecurityInfo& GetSecurityInfo() const;
+ void SetClient(SecurityStateModelClient* client);
+
// Returns a SecurityInfo describing an individual request for the
// given |profile|.
static void SecurityInfoForRequest(
@@ -142,10 +143,11 @@ class SecurityStateModel
SecurityInfo* security_info);
private:
- explicit SecurityStateModel(content::WebContents* web_contents);
- friend class content::WebContentsUserData<SecurityStateModel>;
-
// The WebContents for which this class describes the security status.
+ //
+ // TODO(estark): this should go away shortly and the model should rely
+ // on its delegate to provide whatever it needs from the
+ // WebContents. https://crbug.com/515071
content::WebContents* web_contents_;
// These data members cache the SecurityInfo for the visible
@@ -155,10 +157,7 @@ class SecurityStateModel
mutable GURL visible_url_;
mutable content::SSLStatus visible_ssl_status_;
- // TODO(estark): The SecurityStateModel temporarily owns and
- // instantiates this member, but it will soon be injected, once the
- // model is compnentized. https://crbug.com/515071
- scoped_ptr<SecurityStateModelClient> client_;
+ SecurityStateModelClient* client_;
DISALLOW_COPY_AND_ASSIGN(SecurityStateModel);
};
« no previous file with comments | « chrome/browser/ssl/chrome_security_state_model_client.cc ('k') | chrome/browser/ssl/security_state_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698