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

Side by Side Diff: Source/core/rendering/RenderThemeChromiumMac.mm

Issue 368003002: Check if drawFocusRingMaskWithFrame:inView: exists when drawing focus ring (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/mac/ThemeMac.mm » ('j') | Source/platform/mac/ThemeMac.mm » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 void RenderThemeChromiumMac::updateEnabledState(NSCell* cell, const RenderObject * o) 619 void RenderThemeChromiumMac::updateEnabledState(NSCell* cell, const RenderObject * o)
620 { 620 {
621 bool oldEnabled = [cell isEnabled]; 621 bool oldEnabled = [cell isEnabled];
622 bool enabled = isEnabled(o); 622 bool enabled = isEnabled(o);
623 if (enabled != oldEnabled) 623 if (enabled != oldEnabled)
624 [cell setEnabled:enabled]; 624 [cell setEnabled:enabled];
625 } 625 }
626 626
627 void RenderThemeChromiumMac::updateFocusedState(NSCell* cell, const RenderObject * o) 627 void RenderThemeChromiumMac::updateFocusedState(NSCell* cell, const RenderObject * o)
628 { 628 {
629 if ([cell respondsToSelector:@selector(drawFocusRingMaskWithFrame:inView:)])
Robert Sesek 2014/07/21 21:14:38 Add a comment as to why you need to do this? You s
630 return;
629 bool oldFocused = [cell showsFirstResponder]; 631 bool oldFocused = [cell showsFirstResponder];
630 bool focused = isFocused(o) && o->style()->outlineStyleIsAuto(); 632 bool focused = isFocused(o) && o->style()->outlineStyleIsAuto();
631 if (focused != oldFocused) 633 if (focused != oldFocused)
632 [cell setShowsFirstResponder:focused]; 634 [cell setShowsFirstResponder:focused];
633 } 635 }
634 636
635 void RenderThemeChromiumMac::updatePressedState(NSCell* cell, const RenderObject * o) 637 void RenderThemeChromiumMac::updatePressedState(NSCell* cell, const RenderObject * o)
636 { 638 {
637 bool oldPressed = [cell isHighlighted]; 639 bool oldPressed = [cell isHighlighted];
638 bool pressed = (o->node() && o->node()->active()); 640 bool pressed = (o->node() && o->node()->active());
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 if (zoomLevel != 1.0f) { 910 if (zoomLevel != 1.0f) {
909 inflatedRect.setWidth(inflatedRect.width() / zoomLevel); 911 inflatedRect.setWidth(inflatedRect.width() / zoomLevel);
910 inflatedRect.setHeight(inflatedRect.height() / zoomLevel); 912 inflatedRect.setHeight(inflatedRect.height() / zoomLevel);
911 paintInfo.context->translate(inflatedRect.x(), inflatedRect.y()); 913 paintInfo.context->translate(inflatedRect.x(), inflatedRect.y());
912 paintInfo.context->scale(zoomLevel, zoomLevel); 914 paintInfo.context->scale(zoomLevel, zoomLevel);
913 paintInfo.context->translate(-inflatedRect.x(), -inflatedRect.y()); 915 paintInfo.context->translate(-inflatedRect.x(), -inflatedRect.y());
914 } 916 }
915 917
916 NSView *view = documentViewFor(o); 918 NSView *view = documentViewFor(o);
917 [popupButton drawWithFrame:inflatedRect inView:view]; 919 [popupButton drawWithFrame:inflatedRect inView:view];
918 #if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
919 if (isFocused(o) && o->style()->outlineStyleIsAuto()) 920 if (isFocused(o) && o->style()->outlineStyleIsAuto())
920 [popupButton _web_drawFocusRingWithFrame:inflatedRect inView:view]; 921 [popupButton _web_drawFocusRingWithFrame:inflatedRect inView:view];
921 #endif
922 [popupButton setControlView:nil]; 922 [popupButton setControlView:nil];
923 923
924 return false; 924 return false;
925 } 925 }
926 926
927 IntSize RenderThemeChromiumMac::meterSizeForBounds(const RenderMeter* renderMete r, const IntRect& bounds) const 927 IntSize RenderThemeChromiumMac::meterSizeForBounds(const RenderMeter* renderMete r, const IntRect& bounds) const
928 { 928 {
929 if (NoControlPart == renderMeter->style()->appearance()) 929 if (NoControlPart == renderMeter->style()->appearance())
930 return bounds.size(); 930 return bounds.size();
931 931
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 NSPopUpButtonCell* popupButton = this->popupButton(); 1263 NSPopUpButtonCell* popupButton = this->popupButton();
1264 1264
1265 // Set the control size based off the rectangle we're painting into. 1265 // Set the control size based off the rectangle we're painting into.
1266 setControlSize(popupButton, popupButtonSizes(), r.size(), o->style()->effect iveZoom()); 1266 setControlSize(popupButton, popupButtonSizes(), r.size(), o->style()->effect iveZoom());
1267 1267
1268 // Update the various states we respond to. 1268 // Update the various states we respond to.
1269 updateActiveState(popupButton, o); 1269 updateActiveState(popupButton, o);
1270 updateCheckedState(popupButton, o); 1270 updateCheckedState(popupButton, o);
1271 updateEnabledState(popupButton, o); 1271 updateEnabledState(popupButton, o);
1272 updatePressedState(popupButton, o); 1272 updatePressedState(popupButton, o);
1273 #if BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
1274 updateFocusedState(popupButton, o); 1273 updateFocusedState(popupButton, o);
1275 #endif
1276 } 1274 }
1277 1275
1278 const IntSize* RenderThemeChromiumMac::menuListSizes() const 1276 const IntSize* RenderThemeChromiumMac::menuListSizes() const
1279 { 1277 {
1280 static const IntSize sizes[3] = { IntSize(9, 0), IntSize(5, 0), IntSize(0, 0 ) }; 1278 static const IntSize sizes[3] = { IntSize(9, 0), IntSize(5, 0), IntSize(0, 0 ) };
1281 return sizes; 1279 return sizes;
1282 } 1280 }
1283 1281
1284 int RenderThemeChromiumMac::minimumMenuListSize(RenderStyle* style) const 1282 int RenderThemeChromiumMac::minimumMenuListSize(RenderStyle* style) const
1285 { 1283 {
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1904 1902
1905 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const 1903 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const
1906 { 1904 {
1907 ControlPart part = style->appearance(); 1905 ControlPart part = style->appearance();
1908 if (part == CheckboxPart || part == RadioPart) 1906 if (part == CheckboxPart || part == RadioPart)
1909 return style->effectiveZoom() != 1; 1907 return style->effectiveZoom() != 1;
1910 return false; 1908 return false;
1911 } 1909 }
1912 1910
1913 } // namespace WebCore 1911 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/platform/mac/ThemeMac.mm » ('j') | Source/platform/mac/ThemeMac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698