summaryrefslogtreecommitdiffstats
path: root/ash/root_window_controller.cc
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-10 06:25:49 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-10 06:25:49 +0000
commitbca9a7ee39bf817edd4976ef2bf314d26feea11f (patch)
treea6b260a3c1d420878528469d49f4a9764bcee6bc /ash/root_window_controller.cc
parent9badbe63637a07eb23112f30fda959f849fe923f (diff)
downloadchromium_src-bca9a7ee39bf817edd4976ef2bf314d26feea11f.zip
chromium_src-bca9a7ee39bf817edd4976ef2bf314d26feea11f.tar.gz
chromium_src-bca9a7ee39bf817edd4976ef2bf314d26feea11f.tar.bz2
ash: Add flag to animate transition from boot splash screen.
This adds an --ash-animate-from-boot-splash-screen flag that can be set to tell Ash to grab the Chrome OS boot splash screen and fade from it into the login screen's brightness/grayscale desktop background animation. I'm also making SystemBackgroundController just control a solid-color layer and moving its host-window-grabbing code into a new BootSplashScreen class. BUG=152309 TEST=add --ash-animate-from-boot-splash-screen to /sbin/session_manager_setup.sh, reboot, and see the animation Review URL: https://chromiumcodereview.appspot.com/11362067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167068 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/root_window_controller.cc')
-rw-r--r--ash/root_window_controller.cc54
1 files changed, 41 insertions, 13 deletions
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index fae9a4b..81b619a 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -18,6 +18,7 @@
#include "ash/system/status_area_widget.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/wm/base_layout_manager.h"
+#include "ash/wm/boot_splash_screen.h"
#include "ash/wm/panel_layout_manager.h"
#include "ash/wm/panel_window_event_filter.h"
#include "ash/wm/property_util.h"
@@ -33,6 +34,7 @@
#include "ash/wm/window_properties.h"
#include "ash/wm/workspace_controller.h"
#include "base/command_line.h"
+#include "base/time.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/capture_client.h"
@@ -53,6 +55,17 @@
namespace ash {
namespace {
+#if defined(OS_CHROMEOS)
+// Background color used for the Chrome OS boot splash screen.
+const SkColor kChromeOsBootColor = SkColorSetARGB(0xff, 0xfe, 0xfe, 0xfe);
+#endif
+
+// Duration for the animation that hides the boot splash screen, in
+// milliseconds. This should be short enough in relation to
+// wm/window_animation.cc's brightness/grayscale fade animation that the login
+// background image animation isn't hidden by the splash screen animation.
+const int kBootSplashScreenHideDurationMs = 500;
+
// Creates a new window for use as a container.
aura::Window* CreateContainer(int window_id,
const char* name,
@@ -293,21 +306,24 @@ void RootWindowController::CreateContainers() {
void RootWindowController::CreateSystemBackground(
bool is_first_run_after_boot) {
- SystemBackgroundController::Content initial_content =
- SystemBackgroundController::CONTENT_BLACK;
+ SkColor color = SK_ColorBLACK;
#if defined(OS_CHROMEOS)
- if (is_first_run_after_boot) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAshCopyHostBackgroundAtBoot)) {
- initial_content = SystemBackgroundController::CONTENT_COPY_FROM_HOST;
- } else {
- initial_content =
- SystemBackgroundController::CONTENT_CHROME_OS_BOOT_COLOR;
- }
- }
+ if (is_first_run_after_boot)
+ color = kChromeOsBootColor;
#endif
system_background_.reset(
- new SystemBackgroundController(root_window_.get(), initial_content));
+ new SystemBackgroundController(root_window_.get(), color));
+
+#if defined(OS_CHROMEOS)
+ // Make a copy of the system's boot splash screen so we can composite it
+ // onscreen until the desktop background is ready.
+ if (is_first_run_after_boot &&
+ (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshCopyHostBackgroundAtBoot) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshAnimateFromBootSplashScreen)))
+ boot_splash_screen_.reset(new BootSplashScreen(root_window_.get()));
+#endif
}
void RootWindowController::CreateLauncher() {
@@ -350,8 +366,20 @@ void RootWindowController::UpdateAfterLoginStatusChange(
status_area_widget_->UpdateAfterLoginStatusChange(status);
}
+void RootWindowController::HandleInitialDesktopBackgroundAnimationStarted() {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshAnimateFromBootSplashScreen) &&
+ boot_splash_screen_.get()) {
+ // Make the splash screen fade out so it doesn't obscure the desktop
+ // wallpaper's brightness/grayscale animation.
+ boot_splash_screen_->StartHideAnimation(
+ base::TimeDelta::FromMilliseconds(kBootSplashScreenHideDurationMs));
+ }
+}
+
void RootWindowController::HandleDesktopBackgroundVisible() {
- system_background_->SetContent(SystemBackgroundController::CONTENT_BLACK);
+ system_background_->SetColor(SK_ColorBLACK);
+ boot_splash_screen_.reset();
}
void RootWindowController::CloseChildWindows() {