| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 NotifyTransitionStarted(); | 232 NotifyTransitionStarted(); |
| 233 SetTransition(transition); | 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::EASE_IN_OUT); |
| 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 |
| 244 transition_animation_->Show(); | 244 transition_animation_->Show(); |
| 245 } | 245 } |
| 246 | 246 |
| (...skipping 27 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 |