Chromium Code Reviews| Index: ui/views/window/non_client_view.cc |
| diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc |
| index ed9dc4ab6479ac3363b62989cbe3e200fcff8501..2d89d75e229d70f96c3dcb2f08ccb49c41536413 100644 |
| --- a/ui/views/window/non_client_view.cc |
| +++ b/ui/views/window/non_client_view.cc |
| @@ -43,6 +43,7 @@ bool NonClientFrameView::GetClientMask(const gfx::Size& size, |
| NonClientView::NonClientView() |
| : client_view_(nullptr), |
| + mirror_client_in_rtl_(true), |
| overlay_view_(nullptr) { |
| SetEventTargeter( |
| std::unique_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); |
| @@ -165,7 +166,14 @@ void NonClientView::Layout() { |
| LayoutFrameView(); |
| // Then layout the ClientView, using those bounds. |
| - client_view_->SetBoundsRect(frame_view_->GetBoundsForClientView()); |
| + gfx::Rect client_bounds = frame_view_->GetBoundsForClientView(); |
| + |
| + // RTL code will mirror the ClientView in the frame by default. If this isn't |
| + // desired, pre-mirror it here so the subsequent mirror results in a no-op. |
|
sky
2016/04/29 17:17:27
nit: you're not doing pre-mirror here, rather anot
Greg Levin
2016/05/02 00:49:19
Done.
|
| + if (base::i18n::IsRTL() && !mirror_client_in_rtl_) |
| + client_bounds.set_x(GetMirroredXForRect(client_bounds)); |
| + |
| + client_view_->SetBoundsRect(client_bounds); |
| gfx::Path client_clip; |
| if (frame_view_->GetClientMask(client_view_->size(), &client_clip)) |