Chromium Code Reviews| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 gfx::Rect from_page_origin(GetOffscreenPageBounds(from_page)); | 118 gfx::Rect from_page_origin(GetOffscreenPageBounds(from_page)); |
| 119 gfx::Rect to_page_origin(GetOffscreenPageBounds(to_page)); | 119 gfx::Rect to_page_origin(GetOffscreenPageBounds(to_page)); |
| 120 gfx::Rect from_page_rect(gfx::Tween::RectValueBetween( | 120 gfx::Rect from_page_rect(gfx::Tween::RectValueBetween( |
| 121 progress, from_page_onscreen, from_page_origin)); | 121 progress, from_page_onscreen, from_page_origin)); |
| 122 gfx::Rect to_page_rect( | 122 gfx::Rect to_page_rect( |
| 123 gfx::Tween::RectValueBetween(progress, to_page_origin, to_page_onscreen)); | 123 gfx::Tween::RectValueBetween(progress, to_page_origin, to_page_onscreen)); |
| 124 | 124 |
| 125 contents_view()->GetPageView(from_page)->SetBoundsRect(from_page_rect); | 125 contents_view()->GetPageView(from_page)->SetBoundsRect(from_page_rect); |
| 126 contents_view()->GetPageView(to_page)->SetBoundsRect(to_page_rect); | 126 contents_view()->GetPageView(to_page)->SetBoundsRect(to_page_rect); |
| 127 | 127 |
| 128 // Clip the search view to its target bounds. | |
| 129 int search_results_index = | |
| 130 contents_view()->GetPageIndexForState(AppListModel::STATE_SEARCH_RESULTS); | |
|
Matt Giuca
2014/12/09 07:34:18
This doesn't do what the CL description says, whic
calamity
2014/12/10 05:23:10
Oopz. Yeah, I changed it. It looked bad when the s
| |
| 131 if (from_page == search_results_index) { | |
| 132 contents_view()->GetPageView(from_page)->set_clip_insets( | |
| 133 from_page_rect.InsetsFrom(from_page_onscreen)); | |
| 134 } | |
| 135 if (to_page == search_results_index) { | |
| 136 contents_view()->GetPageView(to_page)->set_clip_insets( | |
| 137 to_page_rect.InsetsFrom(to_page_onscreen)); | |
| 138 } | |
| 139 | |
| 128 UpdateCustomPageForDefaultAnimation(progress, from_page, to_page); | 140 UpdateCustomPageForDefaultAnimation(progress, from_page, to_page); |
| 129 UpdateSearchBoxForDefaultAnimation(progress, from_page, to_page); | 141 UpdateSearchBoxForDefaultAnimation(progress, from_page, to_page); |
| 130 } | 142 } |
| 131 | 143 |
| 132 // StartToAppsAnimator | 144 // StartToAppsAnimator |
| 133 | 145 |
| 134 StartToAppsAnimator::StartToAppsAnimator(ContentsView* contents_view) | 146 StartToAppsAnimator::StartToAppsAnimator(ContentsView* contents_view) |
| 135 : ContentsAnimator(contents_view) { | 147 : ContentsAnimator(contents_view) { |
| 136 } | 148 } |
| 137 | 149 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 gfx::Rect custom_page_rect(gfx::Tween::RectValueBetween( | 193 gfx::Rect custom_page_rect(gfx::Tween::RectValueBetween( |
| 182 progress, custom_page_origin, custom_page_on_screen)); | 194 progress, custom_page_origin, custom_page_on_screen)); |
| 183 | 195 |
| 184 contents_view()->GetPageView(start_page)->SetBoundsRect(start_page_rect); | 196 contents_view()->GetPageView(start_page)->SetBoundsRect(start_page_rect); |
| 185 contents_view()->GetPageView(custom_page)->SetBoundsRect(custom_page_rect); | 197 contents_view()->GetPageView(custom_page)->SetBoundsRect(custom_page_rect); |
| 186 | 198 |
| 187 UpdateSearchBoxForDefaultAnimation(progress, start_page, custom_page); | 199 UpdateSearchBoxForDefaultAnimation(progress, start_page, custom_page); |
| 188 } | 200 } |
| 189 | 201 |
| 190 } // namespace app_list | 202 } // namespace app_list |
| OLD | NEW |