diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 21:39:24 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 21:39:24 +0000 |
commit | aaa71da5c91f106cb627be0a693867014cd7424e (patch) | |
tree | 936368eec610cb8980131e9532b74b7538be5064 /views/view.cc | |
parent | efc607beca3ac04e4f0f4499459ff0314b65689b (diff) | |
download | chromium_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.cc | 10 |
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(); } //////////////////////////////////////////////////////////////////////////////// |