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

Side by Side Diff: chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc

Issue 2928593002: VR: Improving UI colors and elements positioning (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/textures/url_bar_texture.h" 5 #include "chrome/browser/android/vr_shell/textures/url_bar_texture.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/android/vr_shell/textures/render_text_wrapper.h" 11 #include "chrome/browser/android/vr_shell/textures/render_text_wrapper.h"
12 #include "components/security_state/core/security_state.h" 12 #include "components/security_state/core/security_state.h"
13 #include "components/url_formatter/url_formatter.h" 13 #include "components/url_formatter/url_formatter.h"
14 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 #include "third_party/skia/include/core/SkSurface.h" 16 #include "third_party/skia/include/core/SkSurface.h"
17 #include "ui/gfx/color_palette.h" 17 #include "ui/gfx/color_palette.h"
18 #include "ui/gfx/font_list.h" 18 #include "ui/gfx/font_list.h"
19 #include "ui/gfx/render_text.h" 19 #include "ui/gfx/render_text.h"
20 20
21 using security_state::SecurityLevel; 21 using security_state::SecurityLevel;
22 22
23 namespace vr_shell { 23 namespace vr_shell {
24 24
25 // TODO(cjgrant): Use ColorScheme instead of hardcoded values
26 // where it makes sense.
25 static const SkColor kEmphasizedColor = 0xFF000000; 27 static const SkColor kEmphasizedColor = 0xFF000000;
26 static const SkColor kDeemphasizedColor = 0xFF5A5A5A; 28 static const SkColor kDeemphasizedColor = 0xFF5A5A5A;
27 static const SkColor kSecureColor = gfx::kGoogleGreen700; 29 static const SkColor kSecureColor = gfx::kGoogleGreen700;
28 static const SkColor kWarningColor = gfx::kGoogleRed700; 30 static const SkColor kWarningColor = gfx::kGoogleRed700;
29 31
30 static const SkColor kIncognitoDeemphasizedColor = 0xFFE6E6E6; 32 static const SkColor kIncognitoDeemphasizedColor = 0xFF878787;
31 static const SkColor kIncognitoEmphasizedColor = 0xFFFFFFFF; 33 static const SkColor kIncognitoEmphasizedColor = 0xFFEDEDED;
32 static const SkColor kIncognitoSecureColor = 0xFFE6E6E6; 34 static const SkColor kIncognitoSecureColor = 0xFFEDEDED;
33 static const SkColor kIncognitoWarningColor = 0xFFE6E6E6; 35 static const SkColor kIncognitoWarningColor = 0xFFEDEDED;
34 36
35 static constexpr int kUrlWidth = 400; 37 static constexpr int kUrlWidth = 400;
36 static constexpr int kUrlHeight = 30; 38 static constexpr int kUrlHeight = 30;
37 39
38 class TestUrlBarTexture : public UrlBarTexture { 40 class TestUrlBarTexture : public UrlBarTexture {
39 public: 41 public:
40 TestUrlBarTexture(); 42 TestUrlBarTexture();
41 ~TestUrlBarTexture() override {} 43 ~TestUrlBarTexture() override {}
42 44
43 void DrawURL(const GURL& gurl) { 45 void DrawURL(const GURL& gurl) {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 TestUrlBarTexture texture; 199 TestUrlBarTexture texture;
198 texture.DrawURL(GURL( 200 texture.DrawURL(GURL(
199 "https://something.com/" 201 "https://something.com/"
200 "thereisnopossiblewaythatthishostnamecouldbecontainedinthelimitedspacetha" 202 "thereisnopossiblewaythatthishostnamecouldbecontainedinthelimitedspacetha"
201 "tweareaffordedtousitsreallynotsomethingweshouldconsiderorplanfororpinour" 203 "tweareaffordedtousitsreallynotsomethingweshouldconsiderorplanfororpinour"
202 "hopesonlestwegetdisappointedorsad.com")); 204 "hopesonlestwegetdisappointedorsad.com"));
203 EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode()); 205 EXPECT_EQ(UiUnsupportedMode::kCount, texture.unsupported_mode());
204 } 206 }
205 207
206 } // namespace vr_shell 208 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698