Commit 9165179e authored by Biao She's avatar Biao She Committed by Commit Bot

Fix exit warning screen color regression


Bug: 791159
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Idbc8b244d2f39c61eeaccf177cf306e4edc1ba4c
Reviewed-on: https://chromium-review.googlesource.com/804339Reviewed-by: default avatarIan Vollick <vollick@chromium.org>
Commit-Queue: Ian Vollick <vollick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521166}
parent ee50dff9
...@@ -201,6 +201,16 @@ bool UiTexture::GetDefaultFontList(int font_size, ...@@ -201,6 +201,16 @@ bool UiTexture::GetDefaultFontList(int font_size,
return GetFontList(kDefaultFontFamily, font_size, text, font_list); return GetFontList(kDefaultFontFamily, font_size, text, font_list);
} }
SkColor UiTexture::foreground_color() const {
DCHECK(foreground_color_);
return foreground_color_.value();
}
SkColor UiTexture::background_color() const {
DCHECK(background_color_);
return background_color_.value();
}
void UiTexture::SetForegroundColor(SkColor color) { void UiTexture::SetForegroundColor(SkColor color) {
if (foreground_color_ == color) if (foreground_color_ == color)
return; return;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <vector> #include <vector>
#include "base/macros.h" #include "base/macros.h"
#include "base/optional.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
...@@ -110,14 +111,13 @@ class UiTexture { ...@@ -110,14 +111,13 @@ class UiTexture {
static void SetForceFontFallbackFailureForTesting(bool force); static void SetForceFontFallbackFailureForTesting(bool force);
void set_dirty() { dirty_ = true; } void set_dirty() { dirty_ = true; }
SkColor foreground_color() const;
SkColor foreground_color() const { return foreground_color_; } SkColor background_color() const;
SkColor background_color() const { return background_color_; }
private: private:
bool dirty_ = true; bool dirty_ = true;
SkColor foreground_color_; base::Optional<SkColor> foreground_color_;
SkColor background_color_; base::Optional<SkColor> background_color_;
DISALLOW_COPY_AND_ASSIGN(UiTexture); DISALLOW_COPY_AND_ASSIGN(UiTexture);
}; };
......
...@@ -112,6 +112,8 @@ TestUrlBarTexture::TestUrlBarTexture() ...@@ -112,6 +112,8 @@ TestUrlBarTexture::TestUrlBarTexture()
base::Unretained(this))) { base::Unretained(this))) {
gfx::FontList::SetDefaultFontDescription("Arial, Times New Roman, 15px"); gfx::FontList::SetDefaultFontDescription("Arial, Times New Roman, 15px");
SetColors(ColorScheme::GetColorScheme(ColorScheme::kModeNormal).url_bar); SetColors(ColorScheme::GetColorScheme(ColorScheme::kModeNormal).url_bar);
SetBackgroundColor(SK_ColorBLACK);
SetForegroundColor(SK_ColorWHITE);
} }
class MockRenderText : public RenderTextWrapper { class MockRenderText : public RenderTextWrapper {
......
...@@ -333,6 +333,10 @@ void UiSceneCreator::CreateWebVRExitWarning() { ...@@ -333,6 +333,10 @@ void UiSceneCreator::CreateWebVRExitWarning() {
exit_warning->AddBinding(VR_BIND_FUNC(bool, Model, model_, exiting_vr, exit_warning->AddBinding(VR_BIND_FUNC(bool, Model, model_, exiting_vr,
UiElement, exit_warning.get(), UiElement, exit_warning.get(),
SetVisible)); SetVisible));
BindColor(model_, exit_warning.get(), &ColorScheme::exit_warning_background,
&TexturedElement::SetBackgroundColor);
BindColor(model_, exit_warning.get(), &ColorScheme::exit_warning_foreground,
&TexturedElement::SetForegroundColor);
scene_->AddUiElement(k2dBrowsingViewportAwareRoot, std::move(exit_warning)); scene_->AddUiElement(k2dBrowsingViewportAwareRoot, std::move(exit_warning));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment