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

Unified Diff: ui/native_theme/common_theme.cc

Issue 2413223003: Views:: Make Labels support text selection. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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
« no previous file with comments | « ui/gfx/render_text_mac.mm ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/common_theme.cc
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
index 526dea73582c7493a7947f0f7627b09e80c940ee..599f2473b1c3a45a8efd9e9e389714739b1189ba 100644
--- a/ui/native_theme/common_theme.cc
+++ b/ui/native_theme/common_theme.cc
@@ -78,21 +78,22 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
static const SkColor kEnabledMenuItemForegroundColor = SK_ColorBLACK;
// Link:
static const SkColor kLinkEnabledColor = gfx::kGoogleBlue700;
+ // Text selection colors:
+ static const SkColor kTextSelectionBackgroundFocused =
+ SkColorSetARGB(0x54, 0x60, 0xA8, 0xEB);
+ static const SkColor kTextSelectionColor = color_utils::AlphaBlend(
+ SK_ColorBLACK, kTextSelectionBackgroundFocused, 0xdd);
// Textfield:
static const SkColor kTextfieldDefaultColor = SK_ColorBLACK;
static const SkColor kTextfieldDefaultBackground = SK_ColorWHITE;
static const SkColor kTextfieldReadOnlyColor = SK_ColorDKGRAY;
static const SkColor kTextfieldReadOnlyBackground = SK_ColorWHITE;
- static const SkColor kTextfieldSelectionBackgroundFocused =
- SkColorSetARGB(0x54, 0x60, 0xA8, 0xEB);
- static const SkColor kTextfieldSelectionColor = color_utils::AlphaBlend(
- SK_ColorBLACK, kTextfieldSelectionBackgroundFocused, 0xdd);
// Results tables:
static const SkColor kResultsTableText = SK_ColorBLACK;
static const SkColor kResultsTableDimmedText =
SkColorSetRGB(0x64, 0x64, 0x64);
static const SkColor kResultsTableHoveredBackground = color_utils::AlphaBlend(
- kTextfieldSelectionBackgroundFocused, kTextfieldDefaultBackground, 0x40);
+ kTextSelectionBackgroundFocused, kTextfieldDefaultBackground, 0x40);
const SkColor kPositiveTextColor = SkColorSetRGB(0x0b, 0x80, 0x43);
const SkColor kNegativeTextColor = SkColorSetRGB(0xc5, 0x39, 0x29);
static const SkColor kResultsTablePositiveText = color_utils::AlphaBlend(
@@ -102,7 +103,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
kResultsTableHoveredBackground, 0xDD);
static const SkColor kResultsTablePositiveSelectedText =
color_utils::AlphaBlend(kPositiveTextColor,
- kTextfieldSelectionBackgroundFocused, 0xDD);
+ kTextSelectionBackgroundFocused, 0xDD);
static const SkColor kResultsTableNegativeText = color_utils::AlphaBlend(
kNegativeTextColor, kTextfieldDefaultBackground, 0xDD);
static const SkColor kResultsTableNegativeHoveredText =
@@ -110,7 +111,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
kResultsTableHoveredBackground, 0xDD);
static const SkColor kResultsTableNegativeSelectedText =
color_utils::AlphaBlend(kNegativeTextColor,
- kTextfieldSelectionBackgroundFocused, 0xDD);
+ kTextSelectionBackgroundFocused, 0xDD);
// Tooltip:
static const SkColor kTooltipBackground = SkColorSetA(SK_ColorBLACK, 0xCC);
static const SkColor kTooltipTextColor = SkColorSetA(SK_ColorWHITE, 0xDE);
@@ -189,6 +190,10 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
case NativeTheme::kColorId_LabelDisabledColor:
return base_theme->GetSystemColor(
NativeTheme::kColorId_ButtonDisabledColor);
+ case NativeTheme::kColorId_LabelTextSelectionColor:
+ return kTextSelectionColor;
+ case NativeTheme::kColorId_LabelTextSelectionBackgroundFocused:
+ return kTextSelectionBackgroundFocused;
// Link
// TODO(estade): where, if anywhere, do we use disabled links in Chrome?
@@ -209,9 +214,9 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
case NativeTheme::kColorId_TextfieldReadOnlyBackground:
return kTextfieldReadOnlyBackground;
case NativeTheme::kColorId_TextfieldSelectionColor:
- return kTextfieldSelectionColor;
+ return kTextSelectionColor;
case NativeTheme::kColorId_TextfieldSelectionBackgroundFocused:
- return kTextfieldSelectionBackgroundFocused;
+ return kTextSelectionBackgroundFocused;
// Tooltip
case NativeTheme::kColorId_TooltipBackground:
« no previous file with comments | « ui/gfx/render_text_mac.mm ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698