summaryrefslogtreecommitdiffstats
path: root/views/view.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 21:39:24 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 21:39:24 +0000
commitaaa71da5c91f106cb627be0a693867014cd7424e (patch)
tree936368eec610cb8980131e9532b74b7538be5064 /views/view.cc
parentefc607beca3ac04e4f0f4499459ff0314b65689b (diff)
downloadchromium_src-aaa71da5c91f106cb627be0a693867014cd7424e.zip
chromium_src-aaa71da5c91f106cb627be0a693867014cd7424e.tar.gz
chromium_src-aaa71da5c91f106cb627be0a693867014cd7424e.tar.bz2
Implement a TODO.
BUG=none TEST=none Review URL: http://codereview.chromium.org/646053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39494 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view.cc')
-rw-r--r--views/view.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/views/view.cc b/views/view.cc
index 3b823a8..a4e5c57 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -242,17 +242,13 @@ bool View::UILayoutIsRightToLeft() const {
////////////////////////////////////////////////////////////////////////////////
inline int View::MirroredX() const {
- // TODO(beng): reimplement in terms of MirroredLeftPointForRect.
View* parent = GetParent();
- if (parent && parent->UILayoutIsRightToLeft())
- return parent->width() - x() - width();
- return x();
+ return parent ? parent->MirroredLeftPointForRect(bounds_) : x();
}
int View::MirroredLeftPointForRect(const gfx::Rect& bounds) const {
- if (!UILayoutIsRightToLeft())
- return bounds.x();
- return width() - bounds.x() - bounds.width();
+ return UILayoutIsRightToLeft() ?
+ (width() - bounds.x() - bounds.width()) : bounds.x();
}
////////////////////////////////////////////////////////////////////////////////