OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |