summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantrim@chromium.org <antrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-18 15:16:24 +0000
committerantrim@chromium.org <antrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-18 15:16:24 +0000
commit0fadf84de1767ec84a5a21db1d11497c6300033a (patch)
treea35bc5d23601f14db42643cf3e0111608fd08d94
parentd1fc2ff890b641b986cc8ee5db750e0a9762afeb (diff)
downloadchromium_src-0fadf84de1767ec84a5a21db1d11497c6300033a.zip
chromium_src-0fadf84de1767ec84a5a21db1d11497c6300033a.tar.gz
chromium_src-0fadf84de1767ec84a5a21db1d11497c6300033a.tar.bz2
Enable new lock animations by default
BUG=138171, 139461, 162646 TBR=sky Review URL: https://chromiumcodereview.appspot.com/11595008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173731 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/ash_switches.cc2
-rw-r--r--ash/ash_switches.h2
-rw-r--r--ash/shell.cc6
-rw-r--r--ash/wm/power_button_controller_unittest.cc5
-rw-r--r--ash/wm/session_state_controller_impl2.cc9
-rw-r--r--ash/wm/session_state_controller_impl2_unittest.cc4
-rw-r--r--chrome/app/generated_resources.grd4
-rw-r--r--chrome/browser/about_flags.cc4
-rw-r--r--chrome/browser/chromeos/login/screen_locker.cc6
-rw-r--r--chrome/browser/chromeos/login/screen_locker_browsertest.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/login/oobe_ui.cc6
11 files changed, 29 insertions, 21 deletions
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc
index 2c33672..2342b4c 100644
--- a/ash/ash_switches.cc
+++ b/ash/ash_switches.cc
@@ -71,7 +71,7 @@ const char kAshImmersive[] = "ash-immersive";
const char kAshLauncherPerDisplay[] = "ash-launcher-per-display";
// If present new lock animations are enabled.
-const char kAshNewLockAnimationsEnabled[] = "ash-new-lock-animations-enabled";
+const char kAshDisableNewLockAnimations[] = "ash-disable-new-lock-animations";
// Specifies the layout mode and offsets for the secondary display for
// testing. The format is "<t|r|b|l>,<offset>" where t=TOP, r=RIGHT,
diff --git a/ash/ash_switches.h b/ash/ash_switches.h
index 4fd53d5..3b756ec 100644
--- a/ash/ash_switches.h
+++ b/ash/ash_switches.h
@@ -26,6 +26,7 @@ ASH_EXPORT extern const char kAshDebugShortcuts[];
ASH_EXPORT extern const char kAshDisableAutoWindowPlacement[];
ASH_EXPORT extern const char kAshDisablePanelFitting[];
ASH_EXPORT extern const char kAshDisableBootAnimation2[];
+ASH_EXPORT extern const char kAshDisableNewLockAnimations[];
ASH_EXPORT extern const char kAshEnableAdvancedGestures[];
#if defined(OS_LINUX)
ASH_EXPORT extern const char kAshEnableMemoryMonitor[];
@@ -36,7 +37,6 @@ ASH_EXPORT extern const char kAshEnableTrayDragging[];
ASH_EXPORT extern const char kAshEnableWorkspaceScrubbing[];
ASH_EXPORT extern const char kAshImmersive[];
ASH_EXPORT extern const char kAshLauncherPerDisplay[];
-ASH_EXPORT extern const char kAshNewLockAnimationsEnabled[];
ASH_EXPORT extern const char kAshSecondaryDisplayLayout[];
ASH_EXPORT extern const char kAshTouchHud[];
ASH_EXPORT extern const char kAuraLegacyPowerButton[];
diff --git a/ash/shell.cc b/ash/shell.cc
index 0326a26..7e95abf 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -476,10 +476,10 @@ void Shell::Init() {
CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(ash::switches::kAshNewLockAnimationsEnabled))
- session_state_controller_.reset(new SessionStateControllerImpl2);
- else
+ if (command_line->HasSwitch(ash::switches::kAshDisableNewLockAnimations))
session_state_controller_.reset(new SessionStateControllerImpl);
+ else
+ session_state_controller_.reset(new SessionStateControllerImpl2);
power_button_controller_.reset(new PowerButtonController(
session_state_controller_.get()));
AddShellObserver(session_state_controller_.get());
diff --git a/ash/wm/power_button_controller_unittest.cc b/ash/wm/power_button_controller_unittest.cc
index 1e1794d..a2c6cbc 100644
--- a/ash/wm/power_button_controller_unittest.cc
+++ b/ash/wm/power_button_controller_unittest.cc
@@ -62,11 +62,12 @@ class PowerButtonControllerTest : public AshTestBase {
virtual ~PowerButtonControllerTest() {}
virtual void SetUp() OVERRIDE {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ ash::switches::kAshDisableNewLockAnimations);
+
AshTestBase::SetUp();
delegate_ = new TestPowerButtonControllerDelegate;
controller_ = Shell::GetInstance()->power_button_controller();
- CHECK(!CommandLine::ForCurrentProcess()->HasSwitch(
- ash::switches::kAshNewLockAnimationsEnabled));
state_controller_ = static_cast<SessionStateControllerImpl*>(
Shell::GetInstance()->session_state_controller());
state_controller_->SetDelegate(delegate_); // transfers ownership
diff --git a/ash/wm/session_state_controller_impl2.cc b/ash/wm/session_state_controller_impl2.cc
index ed72af5..7629284 100644
--- a/ash/wm/session_state_controller_impl2.cc
+++ b/ash/wm/session_state_controller_impl2.cc
@@ -68,7 +68,9 @@ class AnimationFinishedObserver : public ui::LayerAnimationObserver {
}
// Pauses observer: no checks will be made while paused. It can be used when
- // a sequence has some immediate animations in the beginning.
+ // a sequence has some immediate animations in the beginning, and for
+ // animations that can be tested with flag that makes all animations
+ // immediate.
void Pause() {
paused_ = true;
}
@@ -537,9 +539,11 @@ void SessionStateControllerImpl2::StartUnlockAnimationAfterUIDestroyed() {
&SessionStateControllerImpl2::UnlockAnimationAfterUIDestroyedFinished,
base::Unretained(this));
- ui::LayerAnimationObserver* observer =
+ AnimationFinishedObserver* observer =
new AnimationFinishedObserver(next_animation_starter);
+ observer->Pause();
+
animator_->StartAnimationWithObserver(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
internal::SessionStateAnimator::ANIMATION_DROP,
@@ -553,6 +557,7 @@ void SessionStateControllerImpl2::StartUnlockAnimationAfterUIDestroyed() {
AnimateBackgroundHidingIfNecessary(
internal::SessionStateAnimator::ANIMATION_SPEED_MOVE_WINDOWS,
observer);
+ observer->Unpause();
}
void SessionStateControllerImpl2::StoreUnlockedProperties() {
diff --git a/ash/wm/session_state_controller_impl2_unittest.cc b/ash/wm/session_state_controller_impl2_unittest.cc
index d2207bd..c758feb 100644
--- a/ash/wm/session_state_controller_impl2_unittest.cc
+++ b/ash/wm/session_state_controller_impl2_unittest.cc
@@ -103,8 +103,8 @@ class SessionStateControllerImpl2Test : public AshTestBase {
virtual ~SessionStateControllerImpl2Test() {}
virtual void SetUp() OVERRIDE {
- CommandLine::ForCurrentProcess()->AppendSwitch(
- ash::switches::kAshNewLockAnimationsEnabled);
+ CHECK(!CommandLine::ForCurrentProcess()->HasSwitch(
+ ash::switches::kAshDisableNewLockAnimations));
AshTestBase::SetUp();
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index c1b3d22..eb98160 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -6923,10 +6923,10 @@ Keep your key file in a safe place. You will need it to create new versions of y
Shill Captive Portal detector
</message>
<message name="IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS" desc="Name for the flag to switch lock animations.">
- New lock animations.
+ Disable new lock animations.
</message>
<message name="IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION" desc="Description for the flag to switch lock animations.">
- Enables new lock animations.
+ Disables new lock animations.
</message>
<message name="IDS_FLAGS_ENABLE_LAUNCHER_PER_DISPLAY_NAME" desc="Name for the flag to enable launchers on all displays.">
Enables launcher on all displays.
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 52ff1dd..bcbc93d 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -936,11 +936,11 @@ const Experiment kExperiments[] = {
MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
},
{
- "new-lock-animations",
+ "disable-new-lock-animations",
IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
kOsCrOS,
- SINGLE_VALUE_TYPE(ash::switches::kAshNewLockAnimationsEnabled),
+ SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
},
{
"file-manager-packaged",
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index 6d0837f..8fb3453 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -215,7 +215,9 @@ void ScreenLocker::OnLoginSuccess(
authentication_capture_->using_oauth = using_oauth;
CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(ash::switches::kAshNewLockAnimationsEnabled)) {
+ if (command_line->HasSwitch(ash::switches::kAshDisableNewLockAnimations)) {
+ UnlockOnLoginSuccess();
+ } else {
// Add guard for case when something get broken in call chain to unlock
// for sure.
MessageLoop::current()->PostDelayedTask(
@@ -224,8 +226,6 @@ void ScreenLocker::OnLoginSuccess(
weak_factory_.GetWeakPtr()),
base::TimeDelta::FromMilliseconds(kUnlockGuardTimeoutMs));
delegate_->AnimateAuthenticationSuccess();
- } else {
- UnlockOnLoginSuccess();
}
}
diff --git a/chrome/browser/chromeos/login/screen_locker_browsertest.cc b/chrome/browser/chromeos/login/screen_locker_browsertest.cc
index f29a4bb..d911360 100644
--- a/chrome/browser/chromeos/login/screen_locker_browsertest.cc
+++ b/chrome/browser/chromeos/login/screen_locker_browsertest.cc
@@ -24,6 +24,7 @@
#include "content/public/browser/notification_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/compositor/layer_animator.h"
#include "ui/ui_controls/ui_controls.h"
#include "ui/views/widget/widget.h"
@@ -135,6 +136,7 @@ class ScreenLockerTest : public CrosInProcessBrowserTest {
.Times(AnyNumber());
EXPECT_CALL(*mock_network_library, LoadOncNetworks(_, _, _, _))
.WillRepeatedly(Return(true));
+ ui::LayerAnimator::set_disable_animations_for_test(true);
}
virtual void SetUpCommandLine(CommandLine* command_line) {
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
index ad59a99..5604a44 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -279,10 +279,10 @@ void OobeUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) {
localized_strings->SetString("oobeType", "old");
if (CommandLine::ForCurrentProcess()->
- HasSwitch(ash::switches::kAshNewLockAnimationsEnabled))
- localized_strings->SetString("lockAnimationsType", "new");
- else
+ HasSwitch(ash::switches::kAshDisableNewLockAnimations))
localized_strings->SetString("lockAnimationsType", "old");
+ else
+ localized_strings->SetString("lockAnimationsType", "new");
// If we're not doing boot animation then WebUI should trigger
// wallpaper load on boot.