| OLD | NEW |
| 1 // Copyright (c) 2011 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_INSETS_H_ | 5 #ifndef UI_GFX_INSETS_H_ |
| 6 #define UI_GFX_INSETS_H_ | 6 #define UI_GFX_INSETS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } | 73 } |
| 74 | 74 |
| 75 Insets& operator+=(const Insets& insets) { | 75 Insets& operator+=(const Insets& insets) { |
| 76 top_ += insets.top_; | 76 top_ += insets.top_; |
| 77 left_ += insets.left_; | 77 left_ += insets.left_; |
| 78 bottom_ += insets.bottom_; | 78 bottom_ += insets.bottom_; |
| 79 right_ += insets.right_; | 79 right_ += insets.right_; |
| 80 return *this; | 80 return *this; |
| 81 } | 81 } |
| 82 | 82 |
| 83 Insets operator-() const { |
| 84 return Insets(-top_, -left_, -bottom_, -right_); |
| 85 } |
| 86 |
| 83 // Returns a string representation of the insets. | 87 // Returns a string representation of the insets. |
| 84 std::string ToString() const; | 88 std::string ToString() const; |
| 85 | 89 |
| 86 private: | 90 private: |
| 87 int top_; | 91 int top_; |
| 88 int left_; | 92 int left_; |
| 89 int bottom_; | 93 int bottom_; |
| 90 int right_; | 94 int right_; |
| 91 }; | 95 }; |
| 92 | 96 |
| 93 } // namespace gfx | 97 } // namespace gfx |
| 94 | 98 |
| 95 #endif // UI_GFX_INSETS_H_ | 99 #endif // UI_GFX_INSETS_H_ |
| OLD | NEW |