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

Unified Diff: chrome/browser/android/vr_shell/textures/url_bar_texture.cc

Issue 2887583002: VR: Apply color to URL bar security icons. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/textures/url_bar_texture.cc
diff --git a/chrome/browser/android/vr_shell/textures/url_bar_texture.cc b/chrome/browser/android/vr_shell/textures/url_bar_texture.cc
index 57ca3d2f6b89ef975e5d51d8dbf2b2e039e9f98f..8e809875a237eb95678eb8cdc9e133eae6de7920 100644
--- a/chrome/browser/android/vr_shell/textures/url_bar_texture.cc
+++ b/chrome/browser/android/vr_shell/textures/url_bar_texture.cc
@@ -23,8 +23,11 @@ namespace {
static constexpr SkColor kBackground = 0xCCAAAAAA;
static constexpr SkColor kBackgroundHover = 0xCCDDDDDD;
static constexpr SkColor kForeground = 0xCC444444;
-static constexpr SkColor kSeparatorColor =
- SkColorSetARGBMacro(256 * 0.2, 0, 0, 0);
+static constexpr SkColor kSeparatorColor = 0x51000000;
+
+static constexpr SkColor kInfoOutlineIconColor = 0xFF5A5A5A;
+static constexpr SkColor kLockIconColor = 0xFF0B8043;
+static constexpr SkColor kWarningIconColor = 0xFFC73821;
static constexpr float kWidth = 0.672;
static constexpr float kHeight = 0.088;
@@ -55,6 +58,22 @@ const struct gfx::VectorIcon& getSecurityIcon(int level) {
}
}
+SkColor getSecurityIconColor(int level) {
cjgrant 2017/05/15 21:53:17 This seems cleaner than the above function return
+ switch (level) {
+ case SecurityLevel::NONE:
+ case SecurityLevel::HTTP_SHOW_WARNING:
+ case SecurityLevel::SECURITY_WARNING:
+ return kInfoOutlineIconColor;
+ case SecurityLevel::SECURE:
+ case SecurityLevel::EV_SECURE:
+ return kLockIconColor;
+ case SecurityLevel::SECURE_WITH_POLICY_INSTALLED_CERT:
+ case SecurityLevel::DANGEROUS:
+ default:
+ return kWarningIconColor;
+ }
+}
+
} // namespace
UrlBarTexture::UrlBarTexture() : security_level_(SecurityLevel::DANGEROUS) {}
@@ -126,11 +145,12 @@ void UrlBarTexture::Draw(SkCanvas* canvas, const gfx::Size& texture_size) {
kBackButtonWidth + kSeparatorWidth + kSecurityFieldWidth / 2,
kHeight / 2);
canvas->translate(-kSecurityIconHeight / 2, -kSecurityIconHeight / 2);
- const gfx::VectorIcon& security_icon = getSecurityIcon(security_level_);
- icon_default_height = GetDefaultSizeOfVectorIcon(security_icon);
+ const gfx::VectorIcon& icon = getSecurityIcon(security_level_);
+ icon_default_height = GetDefaultSizeOfVectorIcon(icon);
icon_scale = kSecurityIconHeight / icon_default_height;
+ SkColor icon_color = getSecurityIconColor(security_level_);
canvas->scale(icon_scale, icon_scale);
- PaintVectorIcon(&gfx_canvas, security_icon, kForeground);
+ PaintVectorIcon(&gfx_canvas, icon, icon_color);
canvas->restore();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698