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

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

Issue 2902043005: [vr] Add incognito coloring (Closed)
Patch Set: merged changes from aldo and amp 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
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 3c43bf06aca9c987d7b1bc24a3dbee721ffdea18..5d5b843f7bdd3eb376dcd551ff9f2f07b2d8da0a 100644
--- a/chrome/browser/android/vr_shell/textures/url_bar_texture.cc
+++ b/chrome/browser/android/vr_shell/textures/url_bar_texture.cc
@@ -140,6 +140,18 @@ void UrlBarTexture::SetPressed(bool pressed) {
pressed_ = pressed;
}
+void UrlBarTexture::SetIncognito(bool incognito) {
+ if (incognito_ != incognito)
+ set_dirty();
+ incognito_ = incognito;
+}
+
+SkColor UrlBarTexture::AdjustColorForIncognito(SkColor c) const {
+ if (incognito_)
+ return SkColorSetA(c, 255);
+ return c;
+}
+
void UrlBarTexture::Draw(SkCanvas* canvas, const gfx::Size& texture_size) {
size_.set_height(texture_size.height());
size_.set_width(texture_size.width());
@@ -159,11 +171,11 @@ void UrlBarTexture::Draw(SkCanvas* canvas, const gfx::Size& texture_size) {
SkColor color = hovered_ ? kBackgroundHover : kBackground;
color = pressed_ ? kBackgroundDown : color;
SkPaint paint;
- paint.setColor(color);
+ paint.setColor(AdjustColorForIncognito(color));
canvas->drawRRect(round_rect, paint);
// URL area.
- paint.setColor(kBackground);
+ paint.setColor(AdjustColorForIncognito(kBackground));
SkVector right_corners[4] = {{0, 0}, rounded_corner, rounded_corner, {0, 0}};
round_rect.setRectRadii({kHeight, 0, kWidth, kHeight}, right_corners);
canvas->drawRRect(round_rect, paint);

Powered by Google App Engine
This is Rietveld 408576698