OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TabSize_h | 5 #ifndef TabSize_h |
6 #define TabSize_h | 6 #define TabSize_h |
7 | 7 |
8 #include "wtf/Allocator.h" | 8 #include "platform/wtf/Allocator.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 struct TabSize { | 12 struct TabSize { |
13 DISALLOW_NEW(); | 13 DISALLOW_NEW(); |
14 TabSize(float pixels) : m_floatValue(pixels), m_isSpaces(0) {} | 14 TabSize(float pixels) : m_floatValue(pixels), m_isSpaces(0) {} |
15 | 15 |
16 TabSize(int spaces) : m_floatValue(spaces), m_isSpaces(1) {} | 16 TabSize(int spaces) : m_floatValue(spaces), m_isSpaces(1) {} |
17 | 17 |
18 bool isSpaces() const { return m_isSpaces; } | 18 bool isSpaces() const { return m_isSpaces; } |
(...skipping 10 matching lines...) Expand all Loading... |
29 return (a.m_floatValue == b.m_floatValue) && (a.m_isSpaces == b.m_isSpaces); | 29 return (a.m_floatValue == b.m_floatValue) && (a.m_isSpaces == b.m_isSpaces); |
30 } | 30 } |
31 | 31 |
32 inline bool operator!=(const TabSize& a, const TabSize& b) { | 32 inline bool operator!=(const TabSize& a, const TabSize& b) { |
33 return !(a == b); | 33 return !(a == b); |
34 } | 34 } |
35 | 35 |
36 } // namespace blink | 36 } // namespace blink |
37 | 37 |
38 #endif // TabSize_h | 38 #endif // TabSize_h |
OLD | NEW |