| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 paint.setColor(kMenuPopupBackgroundColor); | 377 paint.setColor(kMenuPopupBackgroundColor); |
| 378 const SkScalar radius = SkIntToScalar(menu_background.corner_radius); | 378 const SkScalar radius = SkIntToScalar(menu_background.corner_radius); |
| 379 SkRect rect = gfx::RectToSkRect(gfx::Rect(size)); | 379 SkRect rect = gfx::RectToSkRect(gfx::Rect(size)); |
| 380 canvas->drawRoundRect(rect, radius, radius, paint); | 380 canvas->drawRoundRect(rect, radius, radius, paint); |
| 381 } | 381 } |
| 382 | 382 |
| 383 void NativeThemeMac::PaintMenuItemBackground( | 383 void NativeThemeMac::PaintMenuItemBackground( |
| 384 SkCanvas* canvas, | 384 SkCanvas* canvas, |
| 385 State state, | 385 State state, |
| 386 const gfx::Rect& rect, | 386 const gfx::Rect& rect, |
| 387 const MenuListExtraParams& menu_list) const { | 387 const MenuItemExtraParams& menu_item) const { |
| 388 SkPaint paint; | 388 SkPaint paint; |
| 389 switch (state) { | 389 switch (state) { |
| 390 case NativeTheme::kNormal: | 390 case NativeTheme::kNormal: |
| 391 case NativeTheme::kDisabled: | 391 case NativeTheme::kDisabled: |
| 392 // Draw nothing over the regular background. | 392 // Draw nothing over the regular background. |
| 393 break; | 393 break; |
| 394 case NativeTheme::kHovered: | 394 case NativeTheme::kHovered: |
| 395 // TODO(tapted): Draw a gradient, and use [NSColor currentControlTint] to | 395 // TODO(tapted): Draw a gradient, and use [NSColor currentControlTint] to |
| 396 // pick colors. The System color "selectedMenuItemColor" is actually still | 396 // pick colors. The System color "selectedMenuItemColor" is actually still |
| 397 // blue for Graphite. And while "keyboardFocusIndicatorColor" does change, | 397 // blue for Graphite. And while "keyboardFocusIndicatorColor" does change, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 409 set_scrollbar_button_length(0); | 409 set_scrollbar_button_length(0); |
| 410 SetScrollbarColors(kScrollerThumbColor, | 410 SetScrollbarColors(kScrollerThumbColor, |
| 411 kScrollerThumbHoverColor, | 411 kScrollerThumbHoverColor, |
| 412 kScrollerTrackGradientColors[0]); | 412 kScrollerTrackGradientColors[0]); |
| 413 } | 413 } |
| 414 | 414 |
| 415 NativeThemeMac::~NativeThemeMac() { | 415 NativeThemeMac::~NativeThemeMac() { |
| 416 } | 416 } |
| 417 | 417 |
| 418 } // namespace ui | 418 } // namespace ui |
| OLD | NEW |