Commit d83ecc53 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Correct some minor color inconsistencies in desktop browser UI.

Both GoogleRed600 and GoogleRed700 were in use. Consolidate on 600.
Both GoogleGreen600 and GoogleGreen700 were in use. Consolidate on 700.

Change some code that hardcodes these colors to instead consult the
NativeTheme.

Bug: 990402
Change-Id: Ie99d58859bac22df7f71134650ab094ce8c1a94a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733094
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686237}
parent 96bb7bcb
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/safe_integer_conversions.h" #include "ui/gfx/geometry/safe_integer_conversions.h"
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
...@@ -145,11 +144,10 @@ void CardUnmaskPromptViews::GotVerificationResult( ...@@ -145,11 +144,10 @@ void CardUnmaskPromptViews::GotVerificationResult(
// Replace the throbber with a warning icon. Since this is a permanent // Replace the throbber with a warning icon. Since this is a permanent
// error we do not intend to return to a previous state. // error we do not intend to return to a previous state.
auto error_icon = std::make_unique<views::ImageView>(); auto error_icon = std::make_unique<views::ImageView>();
// The icon doesn't look good with the dark mode warning text color, error_icon->SetImage(gfx::CreateVectorIcon(
// so use the same color in light mode and dark mode. kBrowserToolsErrorIcon,
// See https://crbug.com/924507 GetNativeTheme()->GetSystemColor(
error_icon->SetImage( ui::NativeTheme::kColorId_AlertSeverityHigh)));
gfx::CreateVectorIcon(kBrowserToolsErrorIcon, gfx::kGoogleRed700));
layout->StartRow(1.0, 0); layout->StartRow(1.0, 0);
layout->AddView(std::move(error_icon)); layout->AddView(std::move(error_icon));
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
#include "components/web_modal/web_contents_modal_dialog_host.h" #include "components/web_modal/web_contents_modal_dialog_host.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h" #include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h" #include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
...@@ -124,7 +124,9 @@ void LocalCardMigrationErrorDialogView::Init() { ...@@ -124,7 +124,9 @@ void LocalCardMigrationErrorDialogView::Init() {
error_view->SetBorder(views::CreateEmptyBorder(kMigrationDialogInsets)); error_view->SetBorder(views::CreateEmptyBorder(kMigrationDialogInsets));
auto* error_image = new views::ImageView(); auto* error_image = new views::ImageView();
error_image->SetImage( error_image->SetImage(
gfx::CreateVectorIcon(kBrowserToolsErrorIcon, gfx::kGoogleRed700)); gfx::CreateVectorIcon(kBrowserToolsErrorIcon,
GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_AlertSeverityHigh)));
error_view->AddChildView(error_image); error_view->AddChildView(error_image);
auto* error_message = new views::Label( auto* error_message = new views::Label(
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include "components/vector_icons/vector_icons.h" #include "components/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/controls/button/button.h" #include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/button/image_button.h" #include "ui/views/controls/button/image_button.h"
...@@ -63,11 +63,9 @@ MigratableCardView::MigratableCardView( ...@@ -63,11 +63,9 @@ MigratableCardView::MigratableCardView(
CONTEXT_BODY_TEXT_SMALL, ChromeTextStyle::STYLE_RED); CONTEXT_BODY_TEXT_SMALL, ChromeTextStyle::STYLE_RED);
checkbox_uncheck_text_container_->AddChildView(checkbox_uncheck_text_); checkbox_uncheck_text_container_->AddChildView(checkbox_uncheck_text_);
// TODO(estade): Check whether kColorId_BubbleFooterBackground can be used for checkbox_uncheck_text_container_->SetBackground(
// the colors here. views::CreateSolidBackground(GetNativeTheme()->GetSystemColor(
checkbox_uncheck_text_container_->SetBackground(views::CreateSolidBackground( ui::NativeTheme::kColorId_BubbleFooterBackground)));
GetNativeTheme()->ShouldUseDarkColors() ? gfx::kGoogleGrey800
: gfx::kGoogleGrey050));
checkbox_uncheck_text_container_->SetVisible(false); checkbox_uncheck_text_container_->SetVisible(false);
AddChildView(checkbox_uncheck_text_container_); AddChildView(checkbox_uncheck_text_container_);
...@@ -125,8 +123,8 @@ MigratableCardView::GetMigratableCardDescriptionView( ...@@ -125,8 +123,8 @@ MigratableCardView::GetMigratableCardDescriptionView(
auto* migration_succeeded_image = new views::ImageView(); auto* migration_succeeded_image = new views::ImageView();
migration_succeeded_image->SetImage(gfx::CreateVectorIcon( migration_succeeded_image->SetImage(gfx::CreateVectorIcon(
vector_icons::kCheckCircleIcon, kMigrationResultImageSize, vector_icons::kCheckCircleIcon, kMigrationResultImageSize,
GetNativeTheme()->ShouldUseDarkColors() ? gfx::kGoogleGreen200 GetNativeTheme()->GetSystemColor(
: gfx::kGoogleGreen700)); ui::NativeTheme::kColorId_AlertSeverityLow)));
migratable_card_description_view->AddChildView(migration_succeeded_image); migratable_card_description_view->AddChildView(migration_succeeded_image);
break; break;
} }
...@@ -134,8 +132,8 @@ MigratableCardView::GetMigratableCardDescriptionView( ...@@ -134,8 +132,8 @@ MigratableCardView::GetMigratableCardDescriptionView(
auto* migration_failed_image = new views::ImageView(); auto* migration_failed_image = new views::ImageView();
migration_failed_image->SetImage(gfx::CreateVectorIcon( migration_failed_image->SetImage(gfx::CreateVectorIcon(
vector_icons::kErrorIcon, kMigrationResultImageSize, vector_icons::kErrorIcon, kMigrationResultImageSize,
GetNativeTheme()->ShouldUseDarkColors() ? gfx::kGoogleRed300 GetNativeTheme()->GetSystemColor(
: gfx::kGoogleRed700)); ui::NativeTheme::kColorId_AlertSeverityHigh)));
migratable_card_description_view->AddChildView(migration_failed_image); migratable_card_description_view->AddChildView(migration_failed_image);
break; break;
} }
......
...@@ -230,7 +230,7 @@ SkColor ChromeTypographyProvider::GetColor(const views::View& view, ...@@ -230,7 +230,7 @@ SkColor ChromeTypographyProvider::GetColor(const views::View& view,
: gfx::kGoogleGrey700; : gfx::kGoogleGrey700;
case STYLE_RED: case STYLE_RED:
return native_theme->ShouldUseDarkColors() ? gfx::kGoogleRed300 return native_theme->ShouldUseDarkColors() ? gfx::kGoogleRed300
: gfx::kGoogleRed700; : gfx::kGoogleRed600;
case STYLE_GREEN: case STYLE_GREEN:
return native_theme->ShouldUseDarkColors() ? gfx::kGoogleGreen300 return native_theme->ShouldUseDarkColors() ? gfx::kGoogleGreen300
: gfx::kGoogleGreen700; : gfx::kGoogleGreen700;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_palette.h" #include "ui/gfx/color_palette.h"
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/background.h" #include "ui/views/background.h"
#include "ui/views/border.h" #include "ui/views/border.h"
#include "ui/views/controls/button/label_button.h" #include "ui/views/controls/button/label_button.h"
...@@ -98,8 +99,10 @@ void EnterpriseStartupDialogView::DisplayErrorMessage( ...@@ -98,8 +99,10 @@ void EnterpriseStartupDialogView::DisplayErrorMessage(
ResetDialog(accept_button.has_value()); ResetDialog(accept_button.has_value());
std::unique_ptr<views::Label> text = CreateText(error_message); std::unique_ptr<views::Label> text = CreateText(error_message);
auto error_icon = std::make_unique<views::ImageView>(); auto error_icon = std::make_unique<views::ImageView>();
error_icon->SetImage(gfx::CreateVectorIcon(kBrowserToolsErrorIcon, kIconSize, error_icon->SetImage(
gfx::kGoogleRed700)); gfx::CreateVectorIcon(kBrowserToolsErrorIcon, kIconSize,
GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_AlertSeverityHigh)));
if (accept_button) if (accept_button)
GetDialogClientView()->ok_button()->SetText(*accept_button); GetDialogClientView()->ok_button()->SetText(*accept_button);
......
...@@ -67,15 +67,15 @@ gfx::ImageSkia ImageForBadgeType(BadgedProfilePhoto::BadgeType badge_type) { ...@@ -67,15 +67,15 @@ gfx::ImageSkia ImageForBadgeType(BadgedProfilePhoto::BadgeType badge_type) {
native_theme->GetSystemColor( native_theme->GetSystemColor(
ui::NativeTheme::kColorId_DefaultIconColor)); ui::NativeTheme::kColorId_DefaultIconColor));
case BadgedProfilePhoto::BADGE_TYPE_SYNC_COMPLETE: case BadgedProfilePhoto::BADGE_TYPE_SYNC_COMPLETE:
return gfx::CreateVectorIcon(kSyncCircleIcon, kBadgeIconSize, return gfx::CreateVectorIcon(
native_theme->ShouldUseDarkColors() kSyncCircleIcon, kBadgeIconSize,
? gfx::kGoogleGreen300 native_theme->GetSystemColor(
: gfx::kGoogleGreen700); ui::NativeTheme::kColorId_AlertSeverityLow));
case BadgedProfilePhoto::BADGE_TYPE_SYNC_ERROR: case BadgedProfilePhoto::BADGE_TYPE_SYNC_ERROR:
return gfx::CreateVectorIcon(kSyncErrorCircleIcon, kBadgeIconSize, return gfx::CreateVectorIcon(
native_theme->ShouldUseDarkColors() kSyncErrorCircleIcon, kBadgeIconSize,
? gfx::kGoogleRed300 native_theme->GetSystemColor(
: gfx::kGoogleRed700); ui::NativeTheme::kColorId_AlertSeverityHigh));
case BadgedProfilePhoto::BADGE_TYPE_SYNC_PAUSED: case BadgedProfilePhoto::BADGE_TYPE_SYNC_PAUSED:
return gfx::CreateVectorIcon( return gfx::CreateVectorIcon(
kSyncPausedCircleIcon, kBadgeIconSize, kSyncPausedCircleIcon, kBadgeIconSize,
......
...@@ -8,11 +8,9 @@ ...@@ -8,11 +8,9 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "base/bind.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h" #include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
...@@ -55,6 +53,7 @@ ...@@ -55,6 +53,7 @@
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/canvas_image_source.h" #include "ui/gfx/image/canvas_image_source.h"
#include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/image/image_skia_operations.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/accessibility/view_accessibility.h" #include "ui/views/accessibility/view_accessibility.h"
namespace { namespace {
...@@ -491,8 +490,10 @@ void ProfileChooserView::AddPreDiceSyncErrorView( ...@@ -491,8 +490,10 @@ void ProfileChooserView::AddPreDiceSyncErrorView(
int content_string_id) { int content_string_id) {
AddMenuGroup(); AddMenuGroup();
auto sync_problem_icon = std::make_unique<views::ImageView>(); auto sync_problem_icon = std::make_unique<views::ImageView>();
sync_problem_icon->SetImage(gfx::CreateVectorIcon( sync_problem_icon->SetImage(
kSyncProblemIcon, BadgedProfilePhoto::kImageSize, gfx::kGoogleRed700)); gfx::CreateVectorIcon(kSyncProblemIcon, BadgedProfilePhoto::kImageSize,
GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_AlertSeverityHigh)));
views::Button* button = CreateAndAddTitleCard( views::Button* button = CreateAndAddTitleCard(
std::move(sync_problem_icon), std::move(sync_problem_icon),
l10n_util::GetStringUTF16(IDS_SYNC_ERROR_USER_MENU_TITLE), l10n_util::GetStringUTF16(IDS_SYNC_ERROR_USER_MENU_TITLE),
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/color_palette.h" #include "ui/gfx/color_palette.h"
...@@ -93,10 +94,8 @@ AuthenticatorClientPinEntryView::AuthenticatorClientPinEntryView( ...@@ -93,10 +94,8 @@ AuthenticatorClientPinEntryView::AuthenticatorClientPinEntryView(
layout->StartRow(views::GridLayout::kFixedSize, 0); layout->StartRow(views::GridLayout::kFixedSize, 0);
auto error_label = std::make_unique<views::Label>( auto error_label = std::make_unique<views::Label>(
base::string16(), views::style::CONTEXT_LABEL, base::string16(), views::style::CONTEXT_LABEL, STYLE_RED);
views::style::STYLE_PRIMARY);
error_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); error_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
error_label->SetEnabledColor(gfx::kGoogleRed500);
error_label_ = layout->AddView(std::move(error_label), 3 /* col_span */, error_label_ = layout->AddView(std::move(error_label), 3 /* col_span */,
1 /* row_span */); 1 /* row_span */);
} }
......
...@@ -370,7 +370,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id, ...@@ -370,7 +370,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
// Alert icon colors // Alert icon colors
case NativeTheme::kColorId_AlertSeverityLow: case NativeTheme::kColorId_AlertSeverityLow:
return gfx::kGoogleGreen600; return gfx::kGoogleGreen700;
case NativeTheme::kColorId_AlertSeverityMedium: case NativeTheme::kColorId_AlertSeverityMedium:
return gfx::kGoogleYellow700; return gfx::kGoogleYellow700;
case NativeTheme::kColorId_AlertSeverityHigh: case NativeTheme::kColorId_AlertSeverityHigh:
......
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