OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 29 matching lines...) Expand all Loading... |
40 // - hour | 40 // - hour |
41 // - minute | 41 // - minute |
42 // - millisecond | 42 // - millisecond |
43 // - second | 43 // - second |
44 // - year | 44 // - year |
45 class DateTimeNumericFieldElement : public DateTimeFieldElement { | 45 class DateTimeNumericFieldElement : public DateTimeFieldElement { |
46 WTF_MAKE_NONCOPYABLE(DateTimeNumericFieldElement); | 46 WTF_MAKE_NONCOPYABLE(DateTimeNumericFieldElement); |
47 | 47 |
48 public: | 48 public: |
49 struct Step { | 49 struct Step { |
50 DISALLOW_ALLOCATION(); | 50 DISALLOW_NEW(); |
51 Step(int step = 1, int stepBase = 0) : step(step), stepBase(stepBase) {
} | 51 Step(int step = 1, int stepBase = 0) : step(step), stepBase(stepBase) {
} |
52 int step; | 52 int step; |
53 int stepBase; | 53 int stepBase; |
54 }; | 54 }; |
55 | 55 |
56 struct Range { | 56 struct Range { |
57 DISALLOW_ALLOCATION(); | 57 DISALLOW_NEW(); |
58 Range(int minimum, int maximum) : minimum(minimum), maximum(maximum) { } | 58 Range(int minimum, int maximum) : minimum(minimum), maximum(maximum) { } |
59 int clampValue(int) const; | 59 int clampValue(int) const; |
60 bool isInRange(int) const; | 60 bool isInRange(int) const; |
61 bool isSingleton() const { return minimum == maximum; } | 61 bool isSingleton() const { return minimum == maximum; } |
62 | 62 |
63 int minimum; | 63 int minimum; |
64 int maximum; | 64 int maximum; |
65 }; | 65 }; |
66 | 66 |
67 protected: | 67 protected: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const Step m_step; | 103 const Step m_step; |
104 int m_value; | 104 int m_value; |
105 bool m_hasValue; | 105 bool m_hasValue; |
106 mutable StringBuilder m_typeAheadBuffer; | 106 mutable StringBuilder m_typeAheadBuffer; |
107 }; | 107 }; |
108 | 108 |
109 } // namespace blink | 109 } // namespace blink |
110 | 110 |
111 #endif | 111 #endif |
112 #endif | 112 #endif |
OLD | NEW |