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

Unified Diff: ash/common/system/tray/tray_popup_label_button_border.cc

Issue 2261593002: Use ScopedRTLFlipCanvas more pervasively for RTL flipping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespace 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 | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_popup_label_button_border.cc
diff --git a/ash/common/system/tray/tray_popup_label_button_border.cc b/ash/common/system/tray/tray_popup_label_button_border.cc
index 65ad099c8b90ff4482eec22f349c38f4da5d7253..6813d0ec42af8025b566dcb00e65452e48e9dfc2 100644
--- a/ash/common/system/tray/tray_popup_label_button_border.cc
+++ b/ash/common/system/tray/tray_popup_label_button_border.cc
@@ -8,6 +8,7 @@
#include "grit/ash_resources.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/vector2d.h"
+#include "ui/gfx/scoped_canvas.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/native_theme_delegate.h"
@@ -85,15 +86,8 @@ void TrayPopupLabelButtonBorder::Paint(const views::View& view,
if (first_visible_child == &view)
return;
}
- if (base::i18n::IsRTL()) {
- canvas->Save();
- canvas->Translate(gfx::Vector2d(view.width(), 0));
- canvas->Scale(-1, 1);
- LabelButtonAssetBorder::Paint(view, canvas);
- canvas->Restore();
- } else {
- LabelButtonAssetBorder::Paint(view, canvas);
- }
+ gfx::ScopedRTLFlipCanvas scoped_canvas(canvas, view.width());
+ LabelButtonAssetBorder::Paint(view, canvas);
}
} // namespace ash
« no previous file with comments | « no previous file | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698