| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #include "core/layout/LayoutSliderThumb.h" | 32 #include "core/layout/LayoutSliderThumb.h" |
| 33 | 33 |
| 34 #include "core/html/forms/SliderThumbElement.h" |
| 34 #include "core/layout/LayoutTheme.h" | 35 #include "core/layout/LayoutTheme.h" |
| 35 #include "core/style/ComputedStyle.h" | 36 #include "core/style/ComputedStyle.h" |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 LayoutSliderThumb::LayoutSliderThumb(SliderThumbElement* element) | 40 LayoutSliderThumb::LayoutSliderThumb(SliderThumbElement* element) |
| 40 : LayoutBlockFlow(element) {} | 41 : LayoutBlockFlow(element) {} |
| 41 | 42 |
| 42 void LayoutSliderThumb::UpdateAppearance(const ComputedStyle& parent_style) { | 43 void LayoutSliderThumb::UpdateAppearance(const ComputedStyle& parent_style) { |
| 43 if (parent_style.Appearance() == kSliderVerticalPart) | 44 if (parent_style.Appearance() == kSliderVerticalPart) |
| 44 MutableStyleRef().SetAppearance(kSliderThumbVerticalPart); | 45 MutableStyleRef().SetAppearance(kSliderThumbVerticalPart); |
| 45 else if (parent_style.Appearance() == kSliderHorizontalPart) | 46 else if (parent_style.Appearance() == kSliderHorizontalPart) |
| 46 MutableStyleRef().SetAppearance(kSliderThumbHorizontalPart); | 47 MutableStyleRef().SetAppearance(kSliderThumbHorizontalPart); |
| 47 else if (parent_style.Appearance() == kMediaSliderPart) | 48 else if (parent_style.Appearance() == kMediaSliderPart) |
| 48 MutableStyleRef().SetAppearance(kMediaSliderThumbPart); | 49 MutableStyleRef().SetAppearance(kMediaSliderThumbPart); |
| 49 else if (parent_style.Appearance() == kMediaVolumeSliderPart) | 50 else if (parent_style.Appearance() == kMediaVolumeSliderPart) |
| 50 MutableStyleRef().SetAppearance(kMediaVolumeSliderThumbPart); | 51 MutableStyleRef().SetAppearance(kMediaVolumeSliderThumbPart); |
| 51 if (StyleRef().HasAppearance()) | 52 if (StyleRef().HasAppearance()) |
| 52 LayoutTheme::GetTheme().AdjustSliderThumbSize(MutableStyleRef()); | 53 LayoutTheme::GetTheme().AdjustSliderThumbSize(MutableStyleRef()); |
| 53 } | 54 } |
| 54 | 55 |
| 55 } // namespace blink | 56 } // namespace blink |
| OLD | NEW |