diff options
author | estade <estade@chromium.org> | 2015-09-24 17:11:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-25 00:12:26 +0000 |
commit | 3b26eed507eb8dcd1ba288a851203cdb5eb115e2 (patch) | |
tree | a9ec803a05999d6d2081dc0ec351521eb1b7d0b5 | |
parent | d1031426306046f68e3b6f81ed971b90f8e49a71 (diff) | |
download | chromium_src-3b26eed507eb8dcd1ba288a851203cdb5eb115e2.zip chromium_src-3b26eed507eb8dcd1ba288a851203cdb5eb115e2.tar.gz chromium_src-3b26eed507eb8dcd1ba288a851203cdb5eb115e2.tar.bz2 |
Share the same value of red for various error states.
This also changes the shade of red as per sgabriel's recommendation.
BUG=none
Review URL: https://codereview.chromium.org/1358203004
Cr-Commit-Position: refs/heads/master@{#350714}
-rw-r--r-- | chrome/browser/ui/autofill/autofill_dialog_types.cc | 3 | ||||
-rw-r--r-- | chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc | 10 | ||||
-rw-r--r-- | ui/gfx/color_palette.h | 2 | ||||
-rw-r--r-- | ui/views/color_constants.cc | 11 | ||||
-rw-r--r-- | ui/views/color_constants.h | 18 | ||||
-rw-r--r-- | ui/views/controls/combobox/combobox.cc | 4 | ||||
-rw-r--r-- | ui/views/views.gyp | 2 | ||||
-rw-r--r-- | ui/views/window/custom_frame_view.cc | 1 |
8 files changed, 5 insertions, 46 deletions
diff --git a/chrome/browser/ui/autofill/autofill_dialog_types.cc b/chrome/browser/ui/autofill/autofill_dialog_types.cc index 90af148..01c7ba5 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_types.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_types.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" +#include "ui/gfx/color_palette.h" namespace { @@ -101,7 +102,7 @@ bool DialogNotification::HasCheckbox() const { return type_ == DialogNotification::WALLET_USAGE_CONFIRMATION; } -SkColor const kWarningColor = SkColorSetRGB(0xd3, 0x2f, 0x2f); +SkColor const kWarningColor = gfx::kErrorRed; SkColor const kLightShadingColor = SkColorSetARGB(7, 0, 0, 0); SkColor const kSubtleBorderColor = SkColorSetARGB(10, 0, 0, 0); diff --git a/chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc index 3fec92b..1eb270f 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc @@ -6,18 +6,8 @@ #include "chrome/browser/ui/autofill/autofill_dialog_types.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(TOOLKIT_VIEWS) -#include "ui/views/color_constants.h" -#endif - namespace autofill { -#if defined(TOOLKIT_VIEWS) -TEST(AutofillDialogTypesTest, WarningColorMatches) { - EXPECT_EQ(kWarningColor, views::kWarningColor); -} -#endif - // Tests for correct parsing of anchor text ranges. TEST(AutofillDialogTypesTest, DialogNotificationLink) { base::string16 text(base::ASCIIToUTF16("Notification without anchor text")); diff --git a/ui/gfx/color_palette.h b/ui/gfx/color_palette.h index d60271f..8b93e7b 100644 --- a/ui/gfx/color_palette.h +++ b/ui/gfx/color_palette.h @@ -11,7 +11,7 @@ namespace gfx { const SkColor kAmber = SkColorSetRGB(0xFF, 0xC1, 0x07); const SkColor kChromeIconGrey = SkColorSetRGB(0x5A, 0x5A, 0x5A); -const SkColor kErrorRed = SkColorSetRGB(0xE5, 0x1C, 0x23); +const SkColor kErrorRed = SkColorSetRGB(0xC5, 0x39, 0x29); const SkColor kGoogleBlue = SkColorSetRGB(0x42, 0x85, 0xF4); } // namespace gfx diff --git a/ui/views/color_constants.cc b/ui/views/color_constants.cc deleted file mode 100644 index f28a2fd..0000000 --- a/ui/views/color_constants.cc +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ui/views/color_constants.h" - -namespace views { - -const SkColor kWarningColor = SkColorSetRGB(0xd3, 0x2f, 0x2f); - -} // namespace views diff --git a/ui/views/color_constants.h b/ui/views/color_constants.h deleted file mode 100644 index 2b0ea68..0000000 --- a/ui/views/color_constants.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_VIEWS_COLOR_CONSTANTS_H_ -#define UI_VIEWS_COLOR_CONSTANTS_H_ - -#include "third_party/skia/include/core/SkColor.h" -#include "ui/views/views_export.h" - -namespace views { - -// TODO(estade): should probably be removed in favor of gfx::kErrorRed. -VIEWS_EXPORT extern const SkColor kWarningColor; - -} // namespace views - -#endif // UI_VIEWS_COLOR_CONSTANTS_H_ diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc index ddf5e40..ad6e5e9 100644 --- a/ui/views/controls/combobox/combobox.cc +++ b/ui/views/controls/combobox/combobox.cc @@ -13,12 +13,12 @@ #include "ui/events/event.h" #include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/canvas.h" +#include "ui/gfx/color_palette.h" #include "ui/gfx/scoped_canvas.h" #include "ui/gfx/text_utils.h" #include "ui/native_theme/common_theme.h" #include "ui/native_theme/native_theme.h" #include "ui/resources/grit/ui_resources.h" -#include "ui/views/color_constants.h" #include "ui/views/controls/button/custom_button.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/combobox/combobox_listener.h" @@ -686,7 +686,7 @@ void Combobox::UpdateBorder() { if (style_ == STYLE_ACTION) border->SetInsets(5, 10, 5, 10); if (invalid_) - border->SetColor(kWarningColor); + border->SetColor(gfx::kErrorRed); SetBorder(border.Pass()); } diff --git a/ui/views/views.gyp b/ui/views/views.gyp index 81f653e..2f60349 100644 --- a/ui/views/views.gyp +++ b/ui/views/views.gyp @@ -56,8 +56,6 @@ 'color_chooser/color_chooser_listener.h', 'color_chooser/color_chooser_view.cc', 'color_chooser/color_chooser_view.h', - 'color_constants.cc', - 'color_constants.h', 'context_menu_controller.h', 'controls/button/blue_button.cc', 'controls/button/blue_button.h', diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc index d048ec8..c41c2e6 100644 --- a/ui/views/window/custom_frame_view.cc +++ b/ui/views/window/custom_frame_view.cc @@ -18,7 +18,6 @@ #include "ui/gfx/path.h" #include "ui/resources/grit/ui_resources.h" #include "ui/strings/grit/ui_strings.h" -#include "ui/views/color_constants.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/resources/grit/views_resources.h" #include "ui/views/views_delegate.h" |