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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 radioCell = [[NSButtonCell alloc] init]; | 342 radioCell = [[NSButtonCell alloc] init]; |
| 343 [radioCell setButtonType:NSRadioButton]; | 343 [radioCell setButtonType:NSRadioButton]; |
| 344 [radioCell setTitle:nil]; | 344 [radioCell setTitle:nil]; |
| 345 [radioCell setFocusRingType:NSFocusRingTypeExterior]; | 345 [radioCell setFocusRingType:NSFocusRingTypeExterior]; |
| 346 } | 346 } |
| 347 | 347 |
| 348 // Set the control size based off the rectangle we're painting into. | 348 // Set the control size based off the rectangle we're painting into. |
| 349 setControlSize(radioCell, radioSizes(), zoomedRect.size(), zoomFactor); | 349 setControlSize(radioCell, radioSizes(), zoomedRect.size(), zoomFactor); |
| 350 | 350 |
| 351 // Update the various states we respond to. | 351 // Update the various states we respond to. |
| 352 // Cocoa draws NSMixedState NSRadioButton as NSOnState so we don't want that . | |
| 353 states &= ~IndeterminateControlState; | |
|
tkent
2014/07/15 01:31:50
Do we have a pixel test for indeterminate radio bu
keishi
2014/07/15 03:05:30
All elements in radio-appearance-basic.html are no
| |
| 352 updateStates(radioCell, states); | 354 updateStates(radioCell, states); |
| 353 | 355 |
| 354 return radioCell; | 356 return radioCell; |
| 355 } | 357 } |
| 356 | 358 |
| 357 static void paintRadio(ControlStates states, GraphicsContext* context, const Int Rect& zoomedRect, float zoomFactor, ScrollView* scrollView) | 359 static void paintRadio(ControlStates states, GraphicsContext* context, const Int Rect& zoomedRect, float zoomFactor, ScrollView* scrollView) |
| 358 { | 360 { |
| 359 // Determine the width and height needed for the control and prepare the cel l for painting. | 361 // Determine the width and height needed for the control and prepare the cel l for painting. |
| 360 NSButtonCell *radioCell = radio(states, zoomedRect, zoomFactor); | 362 NSButtonCell *radioCell = radio(states, zoomedRect, zoomFactor); |
| 361 GraphicsContextStateSaver stateSaver(*context); | 363 GraphicsContextStateSaver stateSaver(*context); |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 719 break; | 721 break; |
| 720 case InnerSpinButtonPart: | 722 case InnerSpinButtonPart: |
| 721 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); | 723 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); |
| 722 break; | 724 break; |
| 723 default: | 725 default: |
| 724 break; | 726 break; |
| 725 } | 727 } |
| 726 } | 728 } |
| 727 | 729 |
| 728 } | 730 } |
| OLD | NEW |