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

Unified Diff: chrome/browser/ui/views/toolbar/app_menu.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 | « chrome/browser/ui/views/download/download_item_view.cc ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/app_menu.cc
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc
index 059863a7c7a08b3f00b5647e3f3cdee189c19990..91638c5e469bc2280f05f6c512ea5504c1bd0e72 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -54,6 +54,7 @@
#include "ui/gfx/font_list.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia_source.h"
+#include "ui/gfx/scoped_canvas.h"
#include "ui/gfx/skia_util.h"
#include "ui/gfx/text_utils.h"
#include "ui/views/background.h"
@@ -162,10 +163,10 @@ class InMenuButtonBackground : public views::Background {
// layout is RTL and the button isn't mirroring itself.
gfx::Rect bounds(view->GetLocalBounds());
if (type_ == LEADING_BORDER) {
- gfx::Rect rect = view->FlipCanvasOnPaintForRTLUI()
- ? gfx::Rect(0, 0, 1, h)
- : gfx::Rect(view->GetMirroredXWithWidthInView(0, 1), 0, 1, h);
- canvas->FillRect(rect, BorderColor(view, views::Button::STATE_NORMAL));
+ gfx::ScopedRTLFlipCanvas scoped_canvas(
+ canvas, view->width(), view->flip_canvas_on_paint_for_rtl_ui());
+ canvas->FillRect(gfx::Rect(0, 0, 1, h),
+ BorderColor(view, views::Button::STATE_NORMAL));
bounds.Inset(gfx::Insets(0, 1, 0, 0));
}
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.cc ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698