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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 2286813002: [User Menu] Flipped the profile badge to be on the LHS for RTL layouts Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 0153322ed673a2a0158c123ed12994b07eb19040..ef5f0818928568d5741cfde9e28c49ffecb9b873 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
+#include "base/i18n/rtl.h"
#include "base/macros.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/utf_string_conversions.h"
@@ -373,8 +374,11 @@ class EditableProfilePhoto : public views::LabelButton {
}
// Calculate the circular mask that will be used to display the photo.
+ // For RTL layouts, right-align the circular mask because profile badge can
+ // appear on the LHS.
circular_mask_.addCircle(
- SkIntToScalar(icon_image_side() / 2),
+ SkIntToScalar(icon_image_side() / 2) +
+ (base::i18n::IsRTL() ? badge_spacing() : 0),
sky 2016/08/26 19:18:27 In general we use the various GetMirrored* functio
SkIntToScalar(icon_image_side() / 2) + badge_spacing(),
SkIntToScalar(icon_image_side() / 2));
@@ -428,6 +432,9 @@ class EditableProfilePhoto : public views::LabelButton {
badge_offset + (switches::IsMaterialDesignUserMenu()
? views::kRelatedControlSmallVerticalSpacing
: 0));
+ // For RTL layouts, left-align the profile badge.
sky 2016/08/26 19:18:27 Similar comment here. Generally you calculate the
+ if (base::i18n::IsRTL())
+ badge_offset_vector.set_x(0);
gfx::Point center_point = bounds.CenterPoint() + badge_offset_vector;
// Paint the circular background.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698