[WebLayer] SecurityLevel+VisibleSecurityState from delegate.
Update PageInfo to get SecurityLevel and VisibleSecurityState from the
delegate, which moves a lot of duplicated logic from wherever PageInfo
is constructed into the delegate, and will also make componentizing
ConnectionInfoPopup and PageInfoController easier, because the
dependency on SecurityStateTabHelper won't be necessary.
UpdateSecurityState and ComputeUIInputs don't need SecurityLevel and
VisibleSecurityState, and have been updated to get them directly from
the delegate instead.
PageInfoTest was setting custom values for these, and so a test-only
method to set security state has been added.
Bug: 1052375
Change-Id: Icf09eba58654d46ca9f9bf075364c1f00793db91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128107
Commit-Queue: Mugdha Lakhani <[email protected]>
Reviewed-by: John Abd-El-Malek <[email protected]>
Cr-Commit-Position: refs/heads/master@{#755050}
diff --git a/components/page_info/page_info_delegate.h b/components/page_info/page_info_delegate.h
index bc4d6ed..6933294 100644
--- a/components/page_info/page_info_delegate.h
+++ b/components/page_info/page_info_delegate.h
@@ -12,6 +12,7 @@
#include "components/permissions/permission_uma_util.h"
#include "components/safe_browsing/buildflags.h"
#include "components/safe_browsing/content/password_protection/metrics_util.h"
+#include "components/security_state/core/security_state.h"
namespace safe_browsing {
class PasswordProtectionService;
@@ -86,6 +87,8 @@
virtual HostContentSettingsMap* GetContentSettings() = 0;
virtual bool IsContentDisplayedInVrHeadset() = 0;
+ virtual security_state::SecurityLevel GetSecurityLevel() = 0;
+ virtual security_state::VisibleSecurityState GetVisibleSecurityState() = 0;
};
#endif // COMPONENTS_PAGE_INFO_PAGE_INFO_DELEGATE_H_