Commit 1b5567e0 authored by warx's avatar warx Committed by Commit bot

ash: Tune shutdown timer in TabletPowerButtonController and shutdown

white animation speed

Changes:
(1) shutdown_timer_ in TabletPowerButtonController changes from 1000ms to 500ms.
(2) animation_speed_shutdown is set to 2500ms for touch view enabled device case.

This change follows the new timing guideline in go/touchview-power.

BUG=633304
TEST=tested on device

Review-Url: https://codereview.chromium.org/2622103003
Cr-Commit-Position: refs/heads/master@{#443012}
parent 916f273d
......@@ -23,7 +23,7 @@ namespace {
// Amount of time the power button must be held to start the pre-shutdown
// animation when in tablet mode.
constexpr int kShutdownTimeoutMs = 1000;
constexpr int kShutdownTimeoutMs = 500;
// Amount of time since last SuspendDone() that power button event needs to be
// ignored.
......
......@@ -4,9 +4,11 @@
#include "ash/wm/session_state_animator.h"
#include "ash/common/ash_switches.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/shell.h"
#include "ash/wm/window_animations.h"
#include "base/command_line.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/compositor/layer_animation_observer.h"
......@@ -16,6 +18,17 @@
namespace ash {
namespace {
bool IsTouchViewEnabled() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAshEnableTouchView) ||
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAshEnableTouchViewTesting);
}
} // namespace
const int SessionStateAnimator::kAllLockScreenContainersMask =
SessionStateAnimator::LOCK_SCREEN_WALLPAPER |
SessionStateAnimator::LOCK_SCREEN_CONTAINERS |
......@@ -82,7 +95,8 @@ base::TimeDelta SessionStateAnimator::GetDuration(
case ANIMATION_SPEED_UNDO_MOVE_WINDOWS:
return base::TimeDelta::FromMilliseconds(350);
case ANIMATION_SPEED_SHUTDOWN:
return base::TimeDelta::FromMilliseconds(1000);
return IsTouchViewEnabled() ? base::TimeDelta::FromMilliseconds(2500)
: base::TimeDelta::FromMilliseconds(1000);
case ANIMATION_SPEED_REVERT_SHUTDOWN:
return base::TimeDelta::FromMilliseconds(500);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment