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

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: Resync Created 3 years, 11 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
« no previous file with comments | « ui/views/controls/styled_label_unittest.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « ui/views/controls/styled_label_unittest.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698