| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/native_theme/common_theme.h" | 5 #include "ui/native_theme/common_theme.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 #include "ui/base/material_design/material_design_controller.h" | 10 #include "ui/base/material_design/material_design_controller.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Buttons | 51 // Buttons |
| 52 case NativeTheme::kColorId_ButtonEnabledColor: | 52 case NativeTheme::kColorId_ButtonEnabledColor: |
| 53 case NativeTheme::kColorId_ButtonHoverColor: | 53 case NativeTheme::kColorId_ButtonHoverColor: |
| 54 return kButtonEnabledColorMd; | 54 return kButtonEnabledColorMd; |
| 55 | 55 |
| 56 // MenuItem | 56 // MenuItem |
| 57 case NativeTheme::kColorId_FocusedMenuItemBackgroundColor: | 57 case NativeTheme::kColorId_FocusedMenuItemBackgroundColor: |
| 58 return kMenuHighlightBackgroundColorMd; | 58 return kMenuHighlightBackgroundColorMd; |
| 59 case NativeTheme::kColorId_SelectedMenuItemForegroundColor: | 59 case NativeTheme::kColorId_SelectedMenuItemForegroundColor: |
| 60 return kSelectedMenuItemForegroundColorMd; | 60 return kSelectedMenuItemForegroundColorMd; |
| 61 |
| 61 // Link | 62 // Link |
| 62 case NativeTheme::kColorId_LinkEnabled: | 63 case NativeTheme::kColorId_LinkEnabled: |
| 63 case NativeTheme::kColorId_LinkPressed: | 64 case NativeTheme::kColorId_LinkPressed: |
| 64 // Normal and pressed share a color. | 65 // Normal and pressed share a color. |
| 65 return kLinkEnabledColorMd; | 66 return kLinkEnabledColorMd; |
| 66 | 67 |
| 67 // FocusableBorder | 68 // FocusableBorder |
| 68 case NativeTheme::kColorId_FocusedBorderColor: | 69 case NativeTheme::kColorId_FocusedBorderColor: |
| 69 return gfx::kGoogleBlue500; | 70 return gfx::kGoogleBlue500; |
| 70 case NativeTheme::kColorId_UnfocusedBorderColor: | 71 case NativeTheme::kColorId_UnfocusedBorderColor: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 96 case NativeTheme::kColorId_TooltipBackground: | 97 case NativeTheme::kColorId_TooltipBackground: |
| 97 return kTooltipBackgroundMd; | 98 return kTooltipBackgroundMd; |
| 98 case NativeTheme::kColorId_TooltipText: | 99 case NativeTheme::kColorId_TooltipText: |
| 99 return kTooltipTextColorMd; | 100 return kTooltipTextColorMd; |
| 100 | 101 |
| 101 default: | 102 default: |
| 102 break; | 103 break; |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 | 106 |
| 107 // Second wave of MD colors (colors that only appear in secondary UI). |
| 108 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { |
| 109 static const SkColor kPrimaryTextColor = SkColorSetRGB(0x33, 0x33, 0x33); |
| 110 |
| 111 if (color_id == NativeTheme::kColorId_LabelEnabledColor) |
| 112 return kPrimaryTextColor; |
| 113 } |
| 114 |
| 106 // Pre-MD colors. | 115 // Pre-MD colors. |
| 107 // Windows: | 116 // Windows: |
| 108 static const SkColor kWindowBackgroundColor = SK_ColorWHITE; | 117 static const SkColor kWindowBackgroundColor = SK_ColorWHITE; |
| 109 // Dialogs: | 118 // Dialogs: |
| 110 static const SkColor kDialogBackgroundColor = SkColorSetRGB(251, 251, 251); | 119 static const SkColor kDialogBackgroundColor = SkColorSetRGB(251, 251, 251); |
| 111 // FocusableBorder: | 120 // FocusableBorder: |
| 112 static const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); | 121 static const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); |
| 113 static const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); | 122 static const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); |
| 114 // Button: | 123 // Button: |
| 115 static const SkColor kButtonBackgroundColor = SkColorSetRGB(0xDE, 0xDE, 0xDE); | 124 static const SkColor kButtonBackgroundColor = SkColorSetRGB(0xDE, 0xDE, 0xDE); |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 } | 440 } |
| 432 if (menu_item.corner_radius > 0) { | 441 if (menu_item.corner_radius > 0) { |
| 433 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); | 442 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); |
| 434 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); | 443 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); |
| 435 return; | 444 return; |
| 436 } | 445 } |
| 437 canvas->drawRect(gfx::RectToSkRect(rect), paint); | 446 canvas->drawRect(gfx::RectToSkRect(rect), paint); |
| 438 } | 447 } |
| 439 | 448 |
| 440 } // namespace ui | 449 } // namespace ui |
| OLD | NEW |