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

Side by Side Diff: ui/app_list/views/contents_view.cc

Issue 844883002: App list: Fixed rendering issues upon opening the window in RTL mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rewrite calamity TODO in the other file. Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « ui/app_list/views/apps_grid_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/app_list/views/contents_view.h" 5 #include "ui/app_list/views/contents_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 rect = GetContentsBounds(); 487 rect = GetContentsBounds();
488 progress = 1; 488 progress = 1;
489 } 489 }
490 490
491 // Notify the custom launcher page that the active page has changed. 491 // Notify the custom launcher page that the active page has changed.
492 app_list_main_view_->view_delegate()->CustomLauncherPageAnimationChanged( 492 app_list_main_view_->view_delegate()->CustomLauncherPageAnimationChanged(
493 progress); 493 progress);
494 494
495 if (rect.IsEmpty()) 495 if (rect.IsEmpty())
496 return; 496 return;
497 // TODO(mgiuca): Temporary work-around for http://crbug.com/441962 and
498 // http://crbug.com/446978. This will first be called while ContentsView is
499 // 0x0, which means that the child views will be positioned incorrectly in RTL
500 // mode (the position is based on the parent's size). When the parent is later
501 // resized, the children are not repositioned due to http://crbug.com/446407.
502 // Therefore, we must not position the children until the parent is the
503 // correct size.
504 // NOTE: There is a similar hack in AppsGridView::CalculateIdealBounds; both
505 // should be removed once http://crbug.com/446407 is resolved.
506 if (GetContentsBounds().IsEmpty())
507 return;
497 508
498 gfx::Rect offscreen_target(rect); 509 gfx::Rect offscreen_target(rect);
499 offscreen_target.set_x(-rect.width()); 510 offscreen_target.set_x(-rect.width());
500 511
501 int current_page = GetActivePageIndex(); 512 int current_page = GetActivePageIndex();
502 513
503 for (int i = 0; i < view_model_->view_size(); ++i) { 514 for (int i = 0; i < view_model_->view_size(); ++i) {
504 view_model_->view_at(i) 515 view_model_->view_at(i)
505 ->SetBoundsRect(i == current_page ? rect : offscreen_target); 516 ->SetBoundsRect(i == current_page ? rect : offscreen_target);
506 } 517 }
(...skipping 27 matching lines...) Expand all
534 } 545 }
535 546
536 void ContentsView::TransitionStarted() { 547 void ContentsView::TransitionStarted() {
537 } 548 }
538 549
539 void ContentsView::TransitionChanged() { 550 void ContentsView::TransitionChanged() {
540 UpdatePageBounds(); 551 UpdatePageBounds();
541 } 552 }
542 553
543 } // namespace app_list 554 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/apps_grid_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698