OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_GFX_SIZE_BASE_H_ | 5 #ifndef UI_GFX_SIZE_BASE_H_ |
6 #define UI_GFX_SIZE_BASE_H_ | 6 #define UI_GFX_SIZE_BASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 return !(*this == s); | 52 return !(*this == s); |
53 } | 53 } |
54 | 54 |
55 bool IsEmpty() const { | 55 bool IsEmpty() const { |
56 // Size doesn't allow negative dimensions, so testing for 0 is enough. | 56 // Size doesn't allow negative dimensions, so testing for 0 is enough. |
57 return (width_ == 0) || (height_ == 0); | 57 return (width_ == 0) || (height_ == 0); |
58 } | 58 } |
59 | 59 |
60 protected: | 60 protected: |
61 SizeBase(Type width, Type height); | 61 SizeBase(Type width, Type height); |
62 virtual ~SizeBase(); | 62 // Destructor is intentionally made non virtual and protected. |
| 63 // Do not make this public. |
| 64 ~SizeBase(); |
63 | 65 |
64 private: | 66 private: |
65 Type width_; | 67 Type width_; |
66 Type height_; | 68 Type height_; |
67 }; | 69 }; |
68 | 70 |
69 } // namespace gfx | 71 } // namespace gfx |
70 | 72 |
71 #endif // UI_GFX_SIZE_BASE_H_ | 73 #endif // UI_GFX_SIZE_BASE_H_ |
OLD | NEW |