Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2010, 2011, 2012 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2010, 2011, 2012 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 bool pressed = states & PressedControlState; | 161 bool pressed = states & PressedControlState; |
| 162 if (pressed != oldPressed) | 162 if (pressed != oldPressed) |
| 163 [cell setHighlighted:pressed]; | 163 [cell setHighlighted:pressed]; |
| 164 | 164 |
| 165 // Enabled state | 165 // Enabled state |
| 166 bool oldEnabled = [cell isEnabled]; | 166 bool oldEnabled = [cell isEnabled]; |
| 167 bool enabled = states & EnabledControlState; | 167 bool enabled = states & EnabledControlState; |
| 168 if (enabled != oldEnabled) | 168 if (enabled != oldEnabled) |
| 169 [cell setEnabled:enabled]; | 169 [cell setEnabled:enabled]; |
| 170 | 170 |
| 171 #if BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING | |
|
Robert Sesek
2014/07/02 14:45:42
Why is it safe to remove this?
keishi
2014/07/02 15:54:05
Hmm.
setShowsFirstResponder draws the focus ring o
keishi
2014/07/07 09:16:07
I confirmed by building using 10.9 SDK and running
| |
| 172 // Focused state | 171 // Focused state |
| 173 bool oldFocused = [cell showsFirstResponder]; | 172 bool oldFocused = [cell showsFirstResponder]; |
| 174 bool focused = states & FocusControlState; | 173 bool focused = states & FocusControlState; |
| 175 if (focused != oldFocused) | 174 if (focused != oldFocused) |
| 176 [cell setShowsFirstResponder:focused]; | 175 [cell setShowsFirstResponder:focused]; |
| 177 #endif | |
| 178 | 176 |
| 179 // Checked and Indeterminate | 177 // Checked and Indeterminate |
| 180 bool oldIndeterminate = [cell state] == NSMixedState; | 178 bool oldIndeterminate = [cell state] == NSMixedState; |
| 181 bool indeterminate = (states & IndeterminateControlState); | 179 bool indeterminate = (states & IndeterminateControlState); |
| 182 bool checked = states & CheckedControlState; | 180 bool checked = states & CheckedControlState; |
| 183 bool oldChecked = [cell state] == NSOnState; | 181 bool oldChecked = [cell state] == NSOnState; |
| 184 if (oldIndeterminate != indeterminate || checked != oldChecked) | 182 if (oldIndeterminate != indeterminate || checked != oldChecked) |
| 185 [cell setState:indeterminate ? NSMixedState : (checked ? NSOnState : NSO ffState)]; | 183 [cell setState:indeterminate ? NSMixedState : (checked ? NSOnState : NSO ffState)]; |
| 186 | 184 |
| 187 // Window inactive state does not need to be checked explicitly, since we pa int parented to | 185 // Window inactive state does not need to be checked explicitly, since we pa int parented to |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 719 break; | 717 break; |
| 720 case InnerSpinButtonPart: | 718 case InnerSpinButtonPart: |
| 721 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); | 719 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); |
| 722 break; | 720 break; |
| 723 default: | 721 default: |
| 724 break; | 722 break; |
| 725 } | 723 } |
| 726 } | 724 } |
| 727 | 725 |
| 728 } | 726 } |
| OLD | NEW |