| 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 11 matching lines...) Expand all Loading... |
| 22 SkColor GetAuraColor(NativeTheme::ColorId color_id, | 22 SkColor GetAuraColor(NativeTheme::ColorId color_id, |
| 23 const NativeTheme* base_theme) { | 23 const NativeTheme* base_theme) { |
| 24 // Second wave of MD colors (colors that only appear in secondary UI). | 24 // Second wave of MD colors (colors that only appear in secondary UI). |
| 25 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { | 25 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { |
| 26 static const SkColor kPrimaryTextColor = SkColorSetRGB(0x33, 0x33, 0x33); | 26 static const SkColor kPrimaryTextColor = SkColorSetRGB(0x33, 0x33, 0x33); |
| 27 | 27 |
| 28 switch (color_id) { | 28 switch (color_id) { |
| 29 // Labels | 29 // Labels |
| 30 case NativeTheme::kColorId_LabelEnabledColor: | 30 case NativeTheme::kColorId_LabelEnabledColor: |
| 31 return kPrimaryTextColor; | 31 return kPrimaryTextColor; |
| 32 case NativeTheme::kColorId_LabelDisabledColor: |
| 33 return SkColorSetA( |
| 34 base_theme->GetSystemColor(NativeTheme::kColorId_LabelEnabledColor), |
| 35 gfx::kDisabledControlAlpha); |
| 32 | 36 |
| 33 // FocusableBorder | 37 // FocusableBorder |
| 34 case NativeTheme::kColorId_UnfocusedBorderColor: | 38 case NativeTheme::kColorId_UnfocusedBorderColor: |
| 35 return SkColorSetA(SK_ColorBLACK, 0x24); | 39 return SkColorSetA(SK_ColorBLACK, 0x24); |
| 36 | 40 |
| 37 // Textfields | 41 // Textfields |
| 38 case NativeTheme::kColorId_TextfieldDefaultColor: | 42 case NativeTheme::kColorId_TextfieldDefaultColor: |
| 39 return kPrimaryTextColor; | 43 return kPrimaryTextColor; |
| 40 case NativeTheme::kColorId_TextfieldDefaultBackground: | 44 case NativeTheme::kColorId_TextfieldDefaultBackground: |
| 41 return base_theme->GetSystemColor( | 45 return base_theme->GetSystemColor( |
| 42 NativeTheme::kColorId_DialogBackground); | 46 NativeTheme::kColorId_DialogBackground); |
| 43 case NativeTheme::kColorId_TextfieldReadOnlyColor: | 47 case NativeTheme::kColorId_TextfieldReadOnlyColor: |
| 44 return SkColorSetA(kPrimaryTextColor, 0x61); | 48 return SkColorSetA(base_theme->GetSystemColor( |
| 49 NativeTheme::kColorId_TextfieldDefaultColor), |
| 50 gfx::kDisabledControlAlpha); |
| 45 | 51 |
| 46 default: | 52 default: |
| 47 break; | 53 break; |
| 48 } | 54 } |
| 49 } | 55 } |
| 50 | 56 |
| 51 // MD colors. | 57 // MD colors. |
| 52 if (ui::MaterialDesignController::IsModeMaterial()) { | 58 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 53 // Dialogs: | 59 // Dialogs: |
| 54 static const SkColor kDialogBackgroundColorMd = SK_ColorWHITE; | 60 static const SkColor kDialogBackgroundColorMd = SK_ColorWHITE; |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 } | 478 } |
| 473 if (menu_item.corner_radius > 0) { | 479 if (menu_item.corner_radius > 0) { |
| 474 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); | 480 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); |
| 475 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); | 481 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); |
| 476 return; | 482 return; |
| 477 } | 483 } |
| 478 canvas->drawRect(gfx::RectToSkRect(rect), paint); | 484 canvas->drawRect(gfx::RectToSkRect(rect), paint); |
| 479 } | 485 } |
| 480 | 486 |
| 481 } // namespace ui | 487 } // namespace ui |
| OLD | NEW |