summaryrefslogtreecommitdiffstats
path: root/ash/wm/app_list_controller.cc
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 00:26:08 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 00:26:08 +0000
commitb51f39b2364bee171953f11d7375fdda6e4a3d5b (patch)
tree701a93ba1b5ba7fc9fd85c8ae4a64c2a5a1bd4d0 /ash/wm/app_list_controller.cc
parentaae0e5946288261ec691e1490270070734242934 (diff)
downloadchromium_src-b51f39b2364bee171953f11d7375fdda6e4a3d5b.zip
chromium_src-b51f39b2364bee171953f11d7375fdda6e4a3d5b.tar.gz
chromium_src-b51f39b2364bee171953f11d7375fdda6e4a3d5b.tar.bz2
app_list: Make over scroll animation faster.
- Add an over scroll animation duration of 50ms; - Use the over scroll animation duration for transition to invalid page (i.e. over scroll); This was using normal page transition duration of 180ms before. - Use the same duration for snap back animation; This was 100ms and now changed to 50ms. Also fixed a bug that app launcher bubble moves to wrong location if starting an over scroll before previous over scroll snap back animation finishes. BUG=160590 TEST=Verify over scroll animation is fast enough. R=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11275320 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/app_list_controller.cc')
-rw-r--r--ash/wm/app_list_controller.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc
index e0f6fe8..ff50653 100644
--- a/ash/wm/app_list_controller.cc
+++ b/ash/wm/app_list_controller.cc
@@ -11,6 +11,7 @@
#include "ash/shell_window_ids.h"
#include "ash/wm/property_util.h"
#include "ash/wm/shelf_layout_manager.h"
+#include "ui/app_list/app_list_constants.h"
#include "ui/app_list/app_list_view.h"
#include "ui/app_list/pagination_model.h"
#include "ui/aura/focus_manager.h"
@@ -33,9 +34,6 @@ const int kAnimationDurationMs = 200;
// Offset in pixels to animation away/towards the launcher.
const int kAnimationOffset = 8;
-// Duration for snap back animation after over-scroll in milliseconds.
-const int kSnapBackAnimationDurationMs = 100;
-
// The maximum shift in pixels when over-scroll happens.
const int kMaxOverScrollShift = 48;
@@ -348,9 +346,11 @@ void AppListController::TransitionChanged() {
return;
views::Widget* widget = view_->GetWidget();
+ ui::LayerAnimator* widget_animator = GetLayer(widget)->GetAnimator();
if (!pagination_model_->IsRevertingCurrentTransition()) {
- // Update cached |view_bounds_| before the first over-scroll move.
- if (!should_snap_back_)
+ // Update cached |view_bounds_| if it is the first over-scroll move and
+ // widget does not have running animations.
+ if (!should_snap_back_ && !widget_animator->is_animating())
view_bounds_ = widget->GetWindowBoundsInScreen();
const int current_page = pagination_model_->selected_page();
@@ -365,9 +365,9 @@ void AppListController::TransitionChanged() {
should_snap_back_ = true;
} else if (should_snap_back_) {
should_snap_back_ = false;
- ui::ScopedLayerAnimationSettings animation(GetLayer(widget)->GetAnimator());
- animation.SetTransitionDuration(
- base::TimeDelta::FromMilliseconds(kSnapBackAnimationDurationMs));
+ ui::ScopedLayerAnimationSettings animation(widget_animator);
+ animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
+ app_list::kOverscrollPageTransitionDurationMs));
widget->SetBounds(view_bounds_);
}
}