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 "third_party/skia/include/core/SkCanvas.h" | 8 #include "third_party/skia/include/core/SkCanvas.h" |
9 #include "ui/base/resource/material_design/material_design_controller.h" | 9 #include "ui/base/resource/material_design/material_design_controller.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 bool CommonThemeGetSystemColor(NativeTheme::ColorId color_id, SkColor* color) { | 59 bool CommonThemeGetSystemColor(NativeTheme::ColorId color_id, SkColor* color) { |
60 // MD colors. | 60 // MD colors. |
61 if (ui::MaterialDesignController::IsModeMaterial()) { | 61 if (ui::MaterialDesignController::IsModeMaterial()) { |
62 // MenuItem: | 62 // MenuItem: |
63 const SkColor kMenuHighlightBackgroundColorMd = | 63 const SkColor kMenuHighlightBackgroundColorMd = |
64 SkColorSetARGB(0x14, 0x00, 0x00, 0x00); | 64 SkColorSetARGB(0x14, 0x00, 0x00, 0x00); |
65 const SkColor kSelectedMenuItemForegroundColorMd = SK_ColorBLACK; | 65 const SkColor kSelectedMenuItemForegroundColorMd = SK_ColorBLACK; |
66 // Link: | 66 // Link: |
67 const SkColor kLinkDisabledColorMd = SK_ColorBLACK; | 67 const SkColor kLinkDisabledColorMd = SK_ColorBLACK; |
68 const SkColor kLinkEnabledColorMd = SkColorSetRGB(0x33, 0x67, 0xD6); | 68 const SkColor kLinkEnabledColorMd = gfx::kGoogleBlue700; |
69 | 69 |
70 switch (color_id) { | 70 switch (color_id) { |
71 // MenuItem | 71 // MenuItem |
72 case NativeTheme::kColorId_FocusedMenuItemBackgroundColor: | 72 case NativeTheme::kColorId_FocusedMenuItemBackgroundColor: |
73 *color = kMenuHighlightBackgroundColorMd; | 73 *color = kMenuHighlightBackgroundColorMd; |
74 return true; | 74 return true; |
75 case NativeTheme::kColorId_SelectedMenuItemForegroundColor: | 75 case NativeTheme::kColorId_SelectedMenuItemForegroundColor: |
76 *color = kSelectedMenuItemForegroundColorMd; | 76 *color = kSelectedMenuItemForegroundColorMd; |
77 return true; | 77 return true; |
78 // Link | 78 // Link |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // static | 264 // static |
265 scoped_ptr<gfx::Canvas> CommonThemeCreateCanvas(SkCanvas* sk_canvas) { | 265 scoped_ptr<gfx::Canvas> CommonThemeCreateCanvas(SkCanvas* sk_canvas) { |
266 // TODO(pkotwicz): Do something better and don't infer device | 266 // TODO(pkotwicz): Do something better and don't infer device |
267 // scale factor from canvas scale. | 267 // scale factor from canvas scale. |
268 SkMatrix m = sk_canvas->getTotalMatrix(); | 268 SkMatrix m = sk_canvas->getTotalMatrix(); |
269 float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX())); | 269 float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX())); |
270 return make_scoped_ptr(new gfx::Canvas(sk_canvas, device_scale)); | 270 return make_scoped_ptr(new gfx::Canvas(sk_canvas, device_scale)); |
271 } | 271 } |
272 | 272 |
273 } // namespace ui | 273 } // namespace ui |
OLD | NEW |