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

Unified Diff: components/toolbar/toolbar_model_impl.cc

Issue 2399333002: Revert of Delete pre-MD code from OmniboxResultView (Closed)
Patch Set: Created 4 years, 2 months 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 | « components/toolbar/toolbar_model_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/toolbar/toolbar_model_impl.cc
diff --git a/components/toolbar/toolbar_model_impl.cc b/components/toolbar/toolbar_model_impl.cc
index 5e795f8bd96bb2cc405aa7b4657d0e9186a9c292..9329852843ea88254f9dc0016c29db741739f3d2 100644
--- a/components/toolbar/toolbar_model_impl.cc
+++ b/components/toolbar/toolbar_model_impl.cc
@@ -8,6 +8,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "components/grit/components_scaled_resources.h"
#include "components/prefs/pref_service.h"
#include "components/security_state/security_state_model.h"
#include "components/strings/grit/components_strings.h"
@@ -69,6 +70,27 @@
: delegate_->GetSecurityLevel();
}
+int ToolbarModelImpl::GetIcon() const {
+ switch (GetSecurityLevel(false)) {
+ case SecurityStateModel::NONE:
+ case SecurityStateModel::HTTP_SHOW_WARNING:
+ return IDR_LOCATION_BAR_HTTP;
+ case SecurityStateModel::EV_SECURE:
+ case SecurityStateModel::SECURE:
+ return IDR_OMNIBOX_HTTPS_VALID;
+ case SecurityStateModel::SECURITY_WARNING:
+ // Surface Dubious as Neutral.
+ return IDR_LOCATION_BAR_HTTP;
+ case SecurityStateModel::SECURE_WITH_POLICY_INSTALLED_CERT:
+ return IDR_OMNIBOX_HTTPS_POLICY_WARNING;
+ case SecurityStateModel::DANGEROUS:
+ return IDR_OMNIBOX_HTTPS_INVALID;
+ }
+
+ NOTREACHED();
+ return IDR_LOCATION_BAR_HTTP;
+}
+
gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const {
#if !defined(OS_ANDROID) && !defined(OS_IOS)
switch (GetSecurityLevel(false)) {
@@ -87,6 +109,7 @@
return gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID;
}
#endif
+
NOTREACHED();
return gfx::VectorIconId::VECTOR_ICON_NONE;
}
« no previous file with comments | « components/toolbar/toolbar_model_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698