Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: ui/views/view.h

Issue 2595163002: Add origin() method on View and use it to simplify some callers. (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 void SetPosition(const gfx::Point& position); 230 void SetPosition(const gfx::Point& position);
231 void SetX(int x); 231 void SetX(int x);
232 void SetY(int y); 232 void SetY(int y);
233 233
234 // No transformation is applied on the size or the locations. 234 // No transformation is applied on the size or the locations.
235 const gfx::Rect& bounds() const { return bounds_; } 235 const gfx::Rect& bounds() const { return bounds_; }
236 int x() const { return bounds_.x(); } 236 int x() const { return bounds_.x(); }
237 int y() const { return bounds_.y(); } 237 int y() const { return bounds_.y(); }
238 int width() const { return bounds_.width(); } 238 int width() const { return bounds_.width(); }
239 int height() const { return bounds_.height(); } 239 int height() const { return bounds_.height(); }
240 const gfx::Point& origin() const { return bounds_.origin(); }
240 const gfx::Size& size() const { return bounds_.size(); } 241 const gfx::Size& size() const { return bounds_.size(); }
241 242
242 // Returns the bounds of the content area of the view, i.e. the rectangle 243 // Returns the bounds of the content area of the view, i.e. the rectangle
243 // enclosed by the view's border. 244 // enclosed by the view's border.
244 gfx::Rect GetContentsBounds() const; 245 gfx::Rect GetContentsBounds() const;
245 246
246 // Returns the bounds of the view in its own coordinates (i.e. position is 247 // Returns the bounds of the view in its own coordinates (i.e. position is
247 // 0, 0). 248 // 0, 0).
248 gfx::Rect GetLocalBounds() const; 249 gfx::Rect GetLocalBounds() const;
249 250
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 // Observers ------------------------------------------------------------- 1584 // Observers -------------------------------------------------------------
1584 1585
1585 base::ObserverList<ViewObserver> observers_; 1586 base::ObserverList<ViewObserver> observers_;
1586 1587
1587 DISALLOW_COPY_AND_ASSIGN(View); 1588 DISALLOW_COPY_AND_ASSIGN(View);
1588 }; 1589 };
1589 1590
1590 } // namespace views 1591 } // namespace views
1591 1592
1592 #endif // UI_VIEWS_VIEW_H_ 1593 #endif // UI_VIEWS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698