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_VIEWS_VIEW_H_ | 5 #ifndef UI_VIEWS_VIEW_H_ |
6 #define UI_VIEWS_VIEW_H_ | 6 #define UI_VIEWS_VIEW_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 void SetPosition(const gfx::Point& position); | 233 void SetPosition(const gfx::Point& position); |
234 void SetX(int x); | 234 void SetX(int x); |
235 void SetY(int y); | 235 void SetY(int y); |
236 | 236 |
237 // No transformation is applied on the size or the locations. | 237 // No transformation is applied on the size or the locations. |
238 const gfx::Rect& bounds() const { return bounds_; } | 238 const gfx::Rect& bounds() const { return bounds_; } |
239 int x() const { return bounds_.x(); } | 239 int x() const { return bounds_.x(); } |
240 int y() const { return bounds_.y(); } | 240 int y() const { return bounds_.y(); } |
241 int width() const { return bounds_.width(); } | 241 int width() const { return bounds_.width(); } |
242 int height() const { return bounds_.height(); } | 242 int height() const { return bounds_.height(); } |
| 243 const gfx::Point& origin() const { return bounds_.origin(); } |
243 const gfx::Size& size() const { return bounds_.size(); } | 244 const gfx::Size& size() const { return bounds_.size(); } |
244 | 245 |
245 // Returns the bounds of the content area of the view, i.e. the rectangle | 246 // Returns the bounds of the content area of the view, i.e. the rectangle |
246 // enclosed by the view's border. | 247 // enclosed by the view's border. |
247 gfx::Rect GetContentsBounds() const; | 248 gfx::Rect GetContentsBounds() const; |
248 | 249 |
249 // Returns the bounds of the view in its own coordinates (i.e. position is | 250 // Returns the bounds of the view in its own coordinates (i.e. position is |
250 // 0, 0). | 251 // 0, 0). |
251 gfx::Rect GetLocalBounds() const; | 252 gfx::Rect GetLocalBounds() const; |
252 | 253 |
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 // Observers ------------------------------------------------------------- | 1602 // Observers ------------------------------------------------------------- |
1602 | 1603 |
1603 base::ObserverList<ViewObserver> observers_; | 1604 base::ObserverList<ViewObserver> observers_; |
1604 | 1605 |
1605 DISALLOW_COPY_AND_ASSIGN(View); | 1606 DISALLOW_COPY_AND_ASSIGN(View); |
1606 }; | 1607 }; |
1607 | 1608 |
1608 } // namespace views | 1609 } // namespace views |
1609 | 1610 |
1610 #endif // UI_VIEWS_VIEW_H_ | 1611 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |