Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: ui/native_theme/native_theme_mac.mm

Issue 2288003002: Delete IsAtLeastOS10_9() and IsAtMostOS10_9() (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 case kColorId_DisabledEmphasizedMenuItemForegroundColor: 174 case kColorId_DisabledEmphasizedMenuItemForegroundColor:
175 return NSSystemColorToSkColor([NSColor disabledControlTextColor]); 175 return NSSystemColorToSkColor([NSColor disabledControlTextColor]);
176 case kColorId_SelectedMenuItemForegroundColor: 176 case kColorId_SelectedMenuItemForegroundColor:
177 return NSSystemColorToSkColor([NSColor selectedMenuItemTextColor]); 177 return NSSystemColorToSkColor([NSColor selectedMenuItemTextColor]);
178 case kColorId_FocusedMenuItemBackgroundColor: 178 case kColorId_FocusedMenuItemBackgroundColor:
179 case kColorId_HoverMenuItemBackgroundColor: 179 case kColorId_HoverMenuItemBackgroundColor:
180 return NSSystemColorToSkColor([NSColor selectedMenuItemColor]); 180 return NSSystemColorToSkColor([NSColor selectedMenuItemColor]);
181 case kColorId_MenuBackgroundColor: 181 case kColorId_MenuBackgroundColor:
182 return kMenuPopupBackgroundColor; 182 return kMenuPopupBackgroundColor;
183 case kColorId_MenuSeparatorColor: 183 case kColorId_MenuSeparatorColor:
184 return base::mac::IsOS10_9() ? kMenuSeparatorColorMavericks 184 return base::mac::IsAtLeastOS10_10() ? kMenuSeparatorColor
185 : kMenuSeparatorColor; 185 : kMenuSeparatorColorMavericks;
186 case kColorId_MenuBorderColor: 186 case kColorId_MenuBorderColor:
187 return kMenuBorderColor; 187 return kMenuBorderColor;
188 188
189 // Link. 189 // Link.
190 case kColorId_LinkDisabled: 190 case kColorId_LinkDisabled:
191 return SK_ColorBLACK; 191 return SK_ColorBLACK;
192 case kColorId_LinkEnabled: 192 case kColorId_LinkEnabled:
193 return SK_ColorBLUE; 193 return SK_ColorBLUE;
194 case kColorId_LinkPressed: 194 case kColorId_LinkPressed:
195 return SK_ColorRED; 195 return SK_ColorRED;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return GetAuraColor(color_id, this); 236 return GetAuraColor(color_id, this);
237 } 237 }
238 } 238 }
239 239
240 void NativeThemeMac::PaintMenuPopupBackground( 240 void NativeThemeMac::PaintMenuPopupBackground(
241 SkCanvas* canvas, 241 SkCanvas* canvas,
242 const gfx::Size& size, 242 const gfx::Size& size,
243 const MenuBackgroundExtraParams& menu_background) const { 243 const MenuBackgroundExtraParams& menu_background) const {
244 SkPaint paint; 244 SkPaint paint;
245 paint.setAntiAlias(true); 245 paint.setAntiAlias(true);
246 if (base::mac::IsOS10_9()) 246 if (!base::mac::IsAtLeastOS10_10())
247 paint.setColor(kMenuPopupBackgroundColor);
Mark Mentovai 2016/08/29 17:57:56 Looks like you flipped the “then” and “else” sides
Sidney San Martín 2016/08/29 19:26:14 Oof, thanks.
248 else
247 paint.setColor(kMenuPopupBackgroundColorMavericks); 249 paint.setColor(kMenuPopupBackgroundColorMavericks);
248 else
249 paint.setColor(kMenuPopupBackgroundColor);
250 const SkScalar radius = SkIntToScalar(menu_background.corner_radius); 250 const SkScalar radius = SkIntToScalar(menu_background.corner_radius);
251 SkRect rect = gfx::RectToSkRect(gfx::Rect(size)); 251 SkRect rect = gfx::RectToSkRect(gfx::Rect(size));
252 canvas->drawRoundRect(rect, radius, radius, paint); 252 canvas->drawRoundRect(rect, radius, radius, paint);
253 } 253 }
254 254
255 void NativeThemeMac::PaintMenuItemBackground( 255 void NativeThemeMac::PaintMenuItemBackground(
256 SkCanvas* canvas, 256 SkCanvas* canvas,
257 State state, 257 State state,
258 const gfx::Rect& rect, 258 const gfx::Rect& rect,
259 const MenuItemExtraParams& menu_item) const { 259 const MenuItemExtraParams& menu_item) const {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 canvas->drawDRRect(outer_shape, shape, paint); 420 canvas->drawDRRect(outer_shape, shape, paint);
421 } 421 }
422 422
423 NativeThemeMac::NativeThemeMac() { 423 NativeThemeMac::NativeThemeMac() {
424 } 424 }
425 425
426 NativeThemeMac::~NativeThemeMac() { 426 NativeThemeMac::~NativeThemeMac() {
427 } 427 }
428 428
429 } // namespace ui 429 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698