| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 color_utils::AlphaBlend(kPositiveTextColor, | 217 color_utils::AlphaBlend(kPositiveTextColor, |
| 218 kTextfieldSelectionBackgroundFocused, 0xDD); | 218 kTextfieldSelectionBackgroundFocused, 0xDD); |
| 219 static const SkColor kResultsTableNegativeText = color_utils::AlphaBlend( | 219 static const SkColor kResultsTableNegativeText = color_utils::AlphaBlend( |
| 220 kNegativeTextColor, kTextfieldDefaultBackground, 0xDD); | 220 kNegativeTextColor, kTextfieldDefaultBackground, 0xDD); |
| 221 static const SkColor kResultsTableNegativeHoveredText = | 221 static const SkColor kResultsTableNegativeHoveredText = |
| 222 color_utils::AlphaBlend(kNegativeTextColor, | 222 color_utils::AlphaBlend(kNegativeTextColor, |
| 223 kResultsTableHoveredBackground, 0xDD); | 223 kResultsTableHoveredBackground, 0xDD); |
| 224 static const SkColor kResultsTableNegativeSelectedText = | 224 static const SkColor kResultsTableNegativeSelectedText = |
| 225 color_utils::AlphaBlend(kNegativeTextColor, | 225 color_utils::AlphaBlend(kNegativeTextColor, |
| 226 kTextfieldSelectionBackgroundFocused, 0xDD); | 226 kTextfieldSelectionBackgroundFocused, 0xDD); |
| 227 // Material spinner/throbber: | 227 // Material spinner/throbber |
| 228 static const SkColor kThrobberSpinningColor = gfx::kGoogleBlue500; | 228 static const SkColor kThrobberSpinningColor = gfx::kGoogleBlue500; |
| 229 static const SkColor kThrobberWaitingColor = SkColorSetRGB(0xA6, 0xA6, 0xA6); | 229 static const SkColor kThrobberWaitingColor = SkColorSetRGB(0xA6, 0xA6, 0xA6); |
| 230 static const SkColor kThrobberLightColor = SkColorSetRGB(0xF4, 0xF8, 0xFD); | 230 static const SkColor kThrobberLightColor = SkColorSetRGB(0xF4, 0xF8, 0xFD); |
| 231 | 231 |
| 232 switch (color_id) { | 232 switch (color_id) { |
| 233 // Windows | 233 // Windows |
| 234 case NativeTheme::kColorId_WindowBackground: | 234 case NativeTheme::kColorId_WindowBackground: |
| 235 return kWindowBackgroundColor; | 235 return kWindowBackgroundColor; |
| 236 | 236 |
| 237 // Dialogs | 237 // Dialogs |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 return kResultsTableNegativeSelectedText; | 402 return kResultsTableNegativeSelectedText; |
| 403 | 403 |
| 404 // Material spinner/throbber | 404 // Material spinner/throbber |
| 405 case NativeTheme::kColorId_ThrobberSpinningColor: | 405 case NativeTheme::kColorId_ThrobberSpinningColor: |
| 406 return kThrobberSpinningColor; | 406 return kThrobberSpinningColor; |
| 407 case NativeTheme::kColorId_ThrobberWaitingColor: | 407 case NativeTheme::kColorId_ThrobberWaitingColor: |
| 408 return kThrobberWaitingColor; | 408 return kThrobberWaitingColor; |
| 409 case NativeTheme::kColorId_ThrobberLightColor: | 409 case NativeTheme::kColorId_ThrobberLightColor: |
| 410 return kThrobberLightColor; | 410 return kThrobberLightColor; |
| 411 | 411 |
| 412 // Alert icon colors |
| 413 case NativeTheme::kColorId_AlertSeverityLow: |
| 414 return gfx::kGoogleGreen700; |
| 415 case NativeTheme::kColorId_AlertSeverityMedium: |
| 416 return gfx::kGoogleYellow700; |
| 417 case NativeTheme::kColorId_AlertSeverityHigh: |
| 418 return gfx::kGoogleRed700; |
| 419 |
| 412 case NativeTheme::kColorId_NumColors: | 420 case NativeTheme::kColorId_NumColors: |
| 413 break; | 421 break; |
| 414 } | 422 } |
| 415 | 423 |
| 416 NOTREACHED(); | 424 NOTREACHED(); |
| 417 return gfx::kPlaceholderColor; | 425 return gfx::kPlaceholderColor; |
| 418 } | 426 } |
| 419 | 427 |
| 420 void CommonThemePaintMenuItemBackground( | 428 void CommonThemePaintMenuItemBackground( |
| 421 const NativeTheme* theme, | 429 const NativeTheme* theme, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 440 } | 448 } |
| 441 if (menu_item.corner_radius > 0) { | 449 if (menu_item.corner_radius > 0) { |
| 442 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); | 450 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); |
| 443 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); | 451 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); |
| 444 return; | 452 return; |
| 445 } | 453 } |
| 446 canvas->drawRect(gfx::RectToSkRect(rect), paint); | 454 canvas->drawRect(gfx::RectToSkRect(rect), paint); |
| 447 } | 455 } |
| 448 | 456 |
| 449 } // namespace ui | 457 } // namespace ui |
| OLD | NEW |