| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_animator.h" | 5 #include "ui/app_list/views/contents_animator.h" |
| 6 | 6 |
| 7 #include "ui/app_list/app_list_constants.h" | 7 #include "ui/app_list/app_list_constants.h" |
| 8 #include "ui/app_list/app_list_switches.h" | 8 #include "ui/app_list/app_list_switches.h" |
| 9 #include "ui/app_list/views/app_list_main_view.h" | 9 #include "ui/app_list/views/app_list_main_view.h" |
| 10 #include "ui/app_list/views/contents_view.h" | 10 #include "ui/app_list/views/contents_view.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 // These are in ContentsView coordinates. | 89 // These are in ContentsView coordinates. |
| 90 gfx::Rect search_box_from( | 90 gfx::Rect search_box_from( |
| 91 contents_view()->GetSearchBoxBoundsForPageIndex(from_page)); | 91 contents_view()->GetSearchBoxBoundsForPageIndex(from_page)); |
| 92 gfx::Rect search_box_to( | 92 gfx::Rect search_box_to( |
| 93 contents_view()->GetSearchBoxBoundsForPageIndex(to_page)); | 93 contents_view()->GetSearchBoxBoundsForPageIndex(to_page)); |
| 94 | 94 |
| 95 gfx::Rect search_box_rect = | 95 gfx::Rect search_box_rect = |
| 96 gfx::Tween::RectValueBetween(progress, search_box_from, search_box_to); | 96 gfx::Tween::RectValueBetween(progress, search_box_from, search_box_to); |
| 97 | 97 |
| 98 views::View* search_box = contents_view()->GetSearchBoxView(); | 98 SearchBoxView* search_box = contents_view()->GetSearchBoxView(); |
| 99 search_box->GetWidget()->SetBounds( | 99 search_box->GetWidget()->SetBounds(contents_view()->ConvertRectToWidget( |
| 100 contents_view()->ConvertRectToWidget(search_box_rect)); | 100 search_box->GetViewBoundsForSearchBoxContentsBounds(search_box_rect))); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void ContentsAnimator::ClipSearchResultsPageToOnscreenBounds( | 103 void ContentsAnimator::ClipSearchResultsPageToOnscreenBounds( |
| 104 int page_index, | 104 int page_index, |
| 105 const gfx::Rect& current_bounds, | 105 const gfx::Rect& current_bounds, |
| 106 const gfx::Rect& onscreen_bounds) { | 106 const gfx::Rect& onscreen_bounds) { |
| 107 int search_results_index = | 107 int search_results_index = |
| 108 contents_view()->GetPageIndexForState(AppListModel::STATE_SEARCH_RESULTS); | 108 contents_view()->GetPageIndexForState(AppListModel::STATE_SEARCH_RESULTS); |
| 109 if (page_index != search_results_index) | 109 if (page_index != search_results_index) |
| 110 return; | 110 return; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 gfx::Rect custom_page_rect(gfx::Tween::RectValueBetween( | 200 gfx::Rect custom_page_rect(gfx::Tween::RectValueBetween( |
| 201 progress, custom_page_origin, custom_page_on_screen)); | 201 progress, custom_page_origin, custom_page_on_screen)); |
| 202 | 202 |
| 203 contents_view()->GetPageView(start_page)->SetBoundsRect(start_page_rect); | 203 contents_view()->GetPageView(start_page)->SetBoundsRect(start_page_rect); |
| 204 contents_view()->GetPageView(custom_page)->SetBoundsRect(custom_page_rect); | 204 contents_view()->GetPageView(custom_page)->SetBoundsRect(custom_page_rect); |
| 205 | 205 |
| 206 UpdateSearchBoxForDefaultAnimation(progress, start_page, custom_page); | 206 UpdateSearchBoxForDefaultAnimation(progress, start_page, custom_page); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace app_list | 209 } // namespace app_list |
| OLD | NEW |