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

Unified Diff: chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc

Issue 2448943002: Refactor SecurityStateModel/Clients for simplicity and reusability. (Closed)
Patch Set: sync. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/tab_helpers.cc ('k') | chrome/browser/ui/views/browser_dialogs_views_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
diff --git a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
index 56a13470cfb21ce2ec9c31cee11a302d698d0b12..726c9dc33202bff6a5dcd0a5672a978a4d01f3a3 100644
--- a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
+++ b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
@@ -8,12 +8,13 @@
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/search.h"
-#include "chrome/browser/ssl/chrome_security_state_model_client.h"
+#include "chrome/browser/ssl/security_state_tab_helper.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "components/google/core/browser/google_util.h"
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/prefs/pref_service.h"
+#include "components/security_state/core/security_state.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/ssl_status.h"
@@ -68,16 +69,16 @@ bool ChromeToolbarModelDelegate::ShouldDisplayURL() const {
return !search::IsInstantNTP(GetActiveWebContents());
}
-security_state::SecurityStateModel::SecurityLevel
-ChromeToolbarModelDelegate::GetSecurityLevel() const {
+security_state::SecurityLevel ChromeToolbarModelDelegate::GetSecurityLevel()
+ const {
content::WebContents* web_contents = GetActiveWebContents();
// If there is no active WebContents (which can happen during toolbar
// initialization), assume no security style.
if (!web_contents)
- return security_state::SecurityStateModel::NONE;
- auto* client = ChromeSecurityStateModelClient::FromWebContents(web_contents);
- security_state::SecurityStateModel::SecurityInfo security_info;
- client->GetSecurityInfo(&security_info);
+ return security_state::NONE;
+ auto* helper = SecurityStateTabHelper::FromWebContents(web_contents);
+ security_state::SecurityInfo security_info;
+ helper->GetSecurityInfo(&security_info);
return security_info.security_level;
}
@@ -95,11 +96,11 @@ bool ChromeToolbarModelDelegate::FailsMalwareCheck() const {
// initialization), so nothing can fail.
if (!web_contents)
return false;
- security_state::SecurityStateModel::SecurityInfo security_info;
- ChromeSecurityStateModelClient::FromWebContents(web_contents)
+ security_state::SecurityInfo security_info;
+ SecurityStateTabHelper::FromWebContents(web_contents)
->GetSecurityInfo(&security_info);
return security_info.malicious_content_status !=
- security_state::SecurityStateModel::MALICIOUS_CONTENT_STATUS_NONE;
+ security_state::MALICIOUS_CONTENT_STATUS_NONE;
}
content::NavigationController*
« no previous file with comments | « chrome/browser/ui/tab_helpers.cc ('k') | chrome/browser/ui/views/browser_dialogs_views_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698