| 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 "grit/ui_resources.h" | |
| 9 #include "third_party/skia/include/core/SkCanvas.h" | 8 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 11 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| 12 #include "ui/gfx/color_utils.h" | 11 #include "ui/gfx/color_utils.h" |
| 13 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
| 14 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
| 15 #include "ui/gfx/skia_util.h" | 14 #include "ui/gfx/skia_util.h" |
| 16 #include "ui/gfx/sys_color_change_listener.h" | 15 #include "ui/gfx/sys_color_change_listener.h" |
| 16 #include "ui/resources/grit/ui_resources.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 // Theme colors returned by GetSystemColor(). | 20 // Theme colors returned by GetSystemColor(). |
| 21 | 21 |
| 22 // MenuItem: | 22 // MenuItem: |
| 23 const SkColor kMenuBackgroundColor = SK_ColorWHITE; | 23 const SkColor kMenuBackgroundColor = SK_ColorWHITE; |
| 24 const SkColor kMenuHighlightBackgroundColor = SkColorSetRGB(0x42, 0x81, 0xF4); | 24 const SkColor kMenuHighlightBackgroundColor = SkColorSetRGB(0x42, 0x81, 0xF4); |
| 25 const SkColor kMenuInvertedSchemeHighlightBackgroundColor = | 25 const SkColor kMenuInvertedSchemeHighlightBackgroundColor = |
| 26 SkColorSetRGB(48, 48, 48); | 26 SkColorSetRGB(48, 48, 48); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 scoped_ptr<gfx::Canvas> CommonThemeCreateCanvas(SkCanvas* sk_canvas) { | 208 scoped_ptr<gfx::Canvas> CommonThemeCreateCanvas(SkCanvas* sk_canvas) { |
| 209 // TODO(pkotwicz): Do something better and don't infer device | 209 // TODO(pkotwicz): Do something better and don't infer device |
| 210 // scale factor from canvas scale. | 210 // scale factor from canvas scale. |
| 211 SkMatrix m = sk_canvas->getTotalMatrix(); | 211 SkMatrix m = sk_canvas->getTotalMatrix(); |
| 212 float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX())); | 212 float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX())); |
| 213 return scoped_ptr<gfx::Canvas>( | 213 return scoped_ptr<gfx::Canvas>( |
| 214 gfx::Canvas::CreateCanvasWithoutScaling(sk_canvas, device_scale)); | 214 gfx::Canvas::CreateCanvasWithoutScaling(sk_canvas, device_scale)); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace ui | 217 } // namespace ui |
| OLD | NEW |