Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Unified Diff: chrome/browser/chromeos/login/base_login_display_host.cc

Issue 11201002: Removes worskpace 1 code. Will rename next. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove constants and add back kDisableLoginAnimations Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/base_login_display_host.cc
diff --git a/chrome/browser/chromeos/login/base_login_display_host.cc b/chrome/browser/chromeos/login/base_login_display_host.cc
index dfdd61e567a3dcd1e51b0237818dd9b2a43a4334..498345136f1abe96330b36138c82f29a9f84c6b5 100644
--- a/chrome/browser/chromeos/login/base_login_display_host.cc
+++ b/chrome/browser/chromeos/login/base_login_display_host.cc
@@ -7,7 +7,6 @@
#include "ash/desktop_background/desktop_background_controller.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
-#include "ash/wm/workspace_controller.h" // temporary until w2 is the default.
#include "base/bind.h"
#include "base/command_line.h"
#include "base/file_util.h"
@@ -57,25 +56,6 @@
namespace {
-// Whether sign in transitions are enabled.
-const bool kEnableBackgroundAnimation = false;
-const bool kEnableBrowserWindowsOpacityAnimation = true;
-const bool kEnableBrowserWindowsTransformAnimation = true;
-
-// Sign in transition timings.
-static const int kBackgroundTransitionPauseMs = 100;
-static const int kBackgroundTransitionDurationMs = 400;
-static const int kBrowserTransitionPauseMs = 750;
-static const int kBrowserTransitionDurationMs = 350;
-
-// Parameters for background transform transition.
-const float kBackgroundScale = 1.05f;
-const int kBackgroundTranslate = -50;
-
-// Parameters for browser transform transition.
-const float kBrowserScale = 1.05f;
-const int kBrowserTranslate = -50;
-
// The delay of triggering initialization of the device policy subsystem
// after the login screen is initialized. This makes sure that device policy
// network requests are made while the system is idle waiting for user input.
@@ -328,105 +308,8 @@ void BaseLoginDisplayHost::StartAnimation() {
return;
}
- // If we've been explicitly told not to do login animations, we will skip most
- // of them. In particular, we'll avoid animating the background or animating
- // the browser's transform.
- const CommandLine* command_line = CommandLine::ForCurrentProcess();
- bool disable_animations = command_line->HasSwitch(
- switches::kDisableLoginAnimations);
-
- const bool do_background_animation =
- !ash::internal::WorkspaceController::IsWorkspace2Enabled() &&
- kEnableBackgroundAnimation && !disable_animations;
-
- const bool do_browser_transform_animation =
- kEnableBrowserWindowsTransformAnimation && !disable_animations;
-
- const bool do_browser_opacity_animation =
- kEnableBrowserWindowsOpacityAnimation;
-
- // Background animation.
- if (do_background_animation) {
- ui::Layer* background_layer =
- ash::Shell::GetContainer(
- ash::Shell::GetPrimaryRootWindow(),
- ash::internal::kShellWindowId_DesktopBackgroundContainer)->
- layer();
-
- gfx::Transform background_transform;
- background_transform.SetScale(kBackgroundScale, kBackgroundScale);
- background_transform.SetTranslateX(kBackgroundTranslate);
- background_transform.SetTranslateY(kBackgroundTranslate);
- background_layer->SetTransform(background_transform);
-
- // Pause
- ui::LayerAnimationElement::AnimatableProperties background_pause_properties;
- background_pause_properties.insert(ui::LayerAnimationElement::TRANSFORM);
- background_layer->GetAnimator()->StartAnimation(
- new ui::LayerAnimationSequence(
- ui::LayerAnimationElement::CreatePauseElement(
- background_pause_properties,
- base::TimeDelta::FromMilliseconds(
- kBackgroundTransitionPauseMs))));
-
- ui::ScopedLayerAnimationSettings settings(background_layer->GetAnimator());
- settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
- settings.SetTransitionDuration(
- base::TimeDelta::FromMilliseconds(kBackgroundTransitionDurationMs));
- settings.SetTweenType(ui::Tween::EASE_OUT);
- background_layer->SetTransform(gfx::Transform());
- }
-
- // Browser windows layer opacity and transform animation.
- if (ash::internal::WorkspaceController::IsWorkspace2Enabled()) {
+ if (!command_line->HasSwitch(switches::kDisableLoginAnimations))
ash::Shell::GetInstance()->DoInitialWorkspaceAnimation();
- } else if (do_browser_transform_animation || do_browser_opacity_animation) {
- ui::Layer* default_container_layer =
- ash::Shell::GetContainer(
- ash::Shell::GetPrimaryRootWindow(),
- ash::internal::kShellWindowId_DefaultContainer)->layer();
-
- ui::LayerAnimationElement::AnimatableProperties browser_pause_properties;
-
- // Set the initial opacity and transform.
- if (do_browser_transform_animation) {
- gfx::Transform browser_transform;
- browser_transform.SetScale(kBrowserScale, kBrowserScale);
- browser_transform.SetTranslateX(kBrowserTranslate);
- browser_transform.SetTranslateY(kBrowserTranslate);
- default_container_layer->SetTransform(browser_transform);
- browser_pause_properties.insert(ui::LayerAnimationElement::TRANSFORM);
- }
-
- if (do_browser_opacity_animation) {
- default_container_layer->SetOpacity(0);
- browser_pause_properties.insert(ui::LayerAnimationElement::OPACITY);
- }
-
- // Pause.
- default_container_layer->GetAnimator()->ScheduleAnimation(
- new ui::LayerAnimationSequence(
- ui::LayerAnimationElement::CreatePauseElement(
- browser_pause_properties,
- base::TimeDelta::FromMilliseconds(kBrowserTransitionPauseMs))));
-
- ui::ScopedLayerAnimationSettings settings(
- default_container_layer->GetAnimator());
-
- settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
- settings.SetTransitionDuration(
- base::TimeDelta::FromMilliseconds(kBrowserTransitionDurationMs));
-
- if (do_browser_opacity_animation) {
- // Should interpolate linearly.
- default_container_layer->SetOpacity(1);
- }
-
- if (do_browser_transform_animation) {
- settings.SetTweenType(ui::Tween::EASE_OUT);
- default_container_layer->SetTransform(gfx::Transform());
- }
- }
}
void BaseLoginDisplayHost::OnOwnershipStatusCheckDone(
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698