| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/native_theme_mac.h" | 5 #include "ui/native_theme/native_theme_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 } // namespace | 106 } // namespace |
| 107 | 107 |
| 108 namespace ui { | 108 namespace ui { |
| 109 | 109 |
| 110 // static | 110 // static |
| 111 NativeTheme* NativeTheme::GetInstanceForWeb() { | 111 NativeTheme* NativeTheme::GetInstanceForWeb() { |
| 112 return NativeThemeMac::instance(); | 112 return NativeThemeMac::instance(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // static |
| 116 NativeTheme* NativeTheme::GetInstanceForNativeUi() { |
| 117 return NativeThemeMac::instance(); |
| 118 } |
| 119 |
| 115 // static | 120 // static |
| 116 NativeThemeMac* NativeThemeMac::instance() { | 121 NativeThemeMac* NativeThemeMac::instance() { |
| 117 CR_DEFINE_STATIC_LOCAL(NativeThemeMac, s_native_theme, ()); | 122 CR_DEFINE_STATIC_LOCAL(NativeThemeMac, s_native_theme, ()); |
| 118 return &s_native_theme; | 123 return &s_native_theme; |
| 119 } | 124 } |
| 120 | 125 |
| 121 // static | 126 // static |
| 122 SkColor NativeThemeMac::ApplySystemControlTint(SkColor color) { | 127 SkColor NativeThemeMac::ApplySystemControlTint(SkColor color) { |
| 123 if ([NSColor currentControlTint] == NSGraphiteControlTint) | 128 if ([NSColor currentControlTint] == NSGraphiteControlTint) |
| 124 return ColorToGrayscale(color); | 129 return ColorToGrayscale(color); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 canvas->drawDRRect(outer_shape, shape, paint); | 434 canvas->drawDRRect(outer_shape, shape, paint); |
| 430 } | 435 } |
| 431 | 436 |
| 432 NativeThemeMac::NativeThemeMac() { | 437 NativeThemeMac::NativeThemeMac() { |
| 433 } | 438 } |
| 434 | 439 |
| 435 NativeThemeMac::~NativeThemeMac() { | 440 NativeThemeMac::~NativeThemeMac() { |
| 436 } | 441 } |
| 437 | 442 |
| 438 } // namespace ui | 443 } // namespace ui |
| OLD | NEW |