OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Publicw | 5 * modify it under the terms of the GNU Library General Publicw |
6 * version 2 of the License, or (at your option) any later version. | 6 * version 2 of the License, or (at your option) any later version. |
7 * | 7 * |
8 * This library is distributed in the hope that it will be useful, | 8 * This library is distributed in the hope that it will be useful, |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 * Library General Public License for more details. | 11 * Library General Public License for more details. |
12 * | 12 * |
13 * You should have received a copy of the GNU Library General Public License | 13 * You should have received a copy of the GNU Library General Public License |
14 * along with this library; see the file COPYING.LIB. If not, write to | 14 * along with this library; see the file COPYING.LIB. If not, write to |
15 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 15 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
16 * Boston, MA 02110-1301, USA. | 16 * Boston, MA 02110-1301, USA. |
17 * | 17 * |
18 */ | 18 */ |
19 | 19 |
20 #include "core/layout/LayoutSlider.h" | 20 #include "core/layout/LayoutSlider.h" |
21 | 21 |
22 #include "core/InputTypeNames.h" | 22 #include "core/InputTypeNames.h" |
23 #include "core/dom/shadow/ShadowRoot.h" | 23 #include "core/dom/shadow/ShadowRoot.h" |
24 #include "core/html/HTMLInputElement.h" | 24 #include "core/html/HTMLInputElement.h" |
25 #include "core/html/shadow/ShadowElementNames.h" | 25 #include "core/html/shadow/ShadowElementNames.h" |
26 #include "core/html/shadow/SliderThumbElement.h" | 26 #include "core/html/shadow/SliderThumbElement.h" |
27 #include "core/layout/LayoutSliderThumb.h" | 27 #include "core/layout/LayoutSliderThumb.h" |
28 #include "wtf/MathExtras.h" | 28 #include "platform/wtf/MathExtras.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 const int LayoutSlider::kDefaultTrackLength = 129; | 32 const int LayoutSlider::kDefaultTrackLength = 129; |
33 | 33 |
34 LayoutSlider::LayoutSlider(HTMLInputElement* element) | 34 LayoutSlider::LayoutSlider(HTMLInputElement* element) |
35 : LayoutFlexibleBox(element) { | 35 : LayoutFlexibleBox(element) { |
36 // We assume LayoutSlider works only with <input type=range>. | 36 // We assume LayoutSlider works only with <input type=range>. |
37 DCHECK_EQ(element->type(), InputTypeNames::range); | 37 DCHECK_EQ(element->type(), InputTypeNames::range); |
38 } | 38 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 ToLayoutSliderThumb(thumb_box)->UpdateAppearance(StyleRef()); | 71 ToLayoutSliderThumb(thumb_box)->UpdateAppearance(StyleRef()); |
72 | 72 |
73 LayoutFlexibleBox::UpdateLayout(); | 73 LayoutFlexibleBox::UpdateLayout(); |
74 } | 74 } |
75 | 75 |
76 bool LayoutSlider::InDragMode() const { | 76 bool LayoutSlider::InDragMode() const { |
77 return GetSliderThumbElement()->IsActive(); | 77 return GetSliderThumbElement()->IsActive(); |
78 } | 78 } |
79 | 79 |
80 } // namespace blink | 80 } // namespace blink |
OLD | NEW |