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/pagination_model.h" | 5 #include "ui/app_list/pagination_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/app_list/pagination_model_observer.h" | 9 #include "ui/app_list/pagination_model_observer.h" |
10 #include "ui/gfx/animation/slide_animation.h" | 10 #include "ui/gfx/animation/slide_animation.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 start_page = -1; | 222 start_page = -1; |
223 else if (target_page > end_page && selected_page_ == end_page) | 223 else if (target_page > end_page && selected_page_ == end_page) |
224 end_page = total_pages_; | 224 end_page = total_pages_; |
225 | 225 |
226 return std::max(start_page, std::min(end_page, target_page)); | 226 return std::max(start_page, std::min(end_page, target_page)); |
227 } | 227 } |
228 | 228 |
229 void PaginationModel::StartTransitionAnimation(const Transition& transition) { | 229 void PaginationModel::StartTransitionAnimation(const Transition& transition) { |
230 DCHECK(selected_page_ != transition.target_page); | 230 DCHECK(selected_page_ != transition.target_page); |
231 | 231 |
232 SetTransition(transition); | |
calamity
2014/07/10 03:59:36
Is this change still needed?
Matt Giuca
2014/07/10 05:31:03
You can revert this change now that we are using T
| |
232 NotifyTransitionStarted(); | 233 NotifyTransitionStarted(); |
233 SetTransition(transition); | |
234 | 234 |
235 transition_animation_.reset(new gfx::SlideAnimation(this)); | 235 transition_animation_.reset(new gfx::SlideAnimation(this)); |
236 transition_animation_->SetTweenType(gfx::Tween::LINEAR); | 236 transition_animation_->SetTweenType(gfx::Tween::LINEAR); |
237 transition_animation_->Reset(transition_.progress); | 237 transition_animation_->Reset(transition_.progress); |
238 | 238 |
239 const int duration = is_valid_page(transition_.target_page) ? | 239 const int duration = is_valid_page(transition_.target_page) ? |
240 transition_duration_ms_ : overscroll_transition_duration_ms_; | 240 transition_duration_ms_ : overscroll_transition_duration_ms_; |
241 if (duration) | 241 if (duration) |
242 transition_animation_->SetSlideDuration(duration); | 242 transition_animation_->SetSlideDuration(duration); |
243 | 243 |
(...skipping 30 matching lines...) Expand all Loading... | |
274 } else if (transition_animation_->GetCurrentValue() == 0) { | 274 } else if (transition_animation_->GetCurrentValue() == 0) { |
275 // Hiding animation ends. No page change should happen. | 275 // Hiding animation ends. No page change should happen. |
276 ResetTransitionAnimation(); | 276 ResetTransitionAnimation(); |
277 } | 277 } |
278 | 278 |
279 if (next_target >= 0) | 279 if (next_target >= 0) |
280 SelectPage(next_target, true); | 280 SelectPage(next_target, true); |
281 } | 281 } |
282 | 282 |
283 } // namespace app_list | 283 } // namespace app_list |
OLD | NEW |