13551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 53551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)#ifndef ASH_WM_BOOT_SPLASH_SCREEN_CHROMEOS_H_ 63551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)#define ASH_WM_BOOT_SPLASH_SCREEN_CHROMEOS_H_ 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string> 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h" 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h" 12eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/time/time.h" 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace aura { 15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class WindowTreeHost; 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ui { 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Layer; 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class LayerDelegate; 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ash { 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// BootSplashScreen manages a ui::Layer, stacked at the top of the root layer's 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// children, that displays a copy of the initial contents of the host window. 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This allows us to continue displaying the Chrome OS boot splash screen (which 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is displayed before Ash starts) after the compositor has taken over so we can 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// animate the transition between the splash screen and the login screen. 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class BootSplashScreen { 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public: 32a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) explicit BootSplashScreen(aura::WindowTreeHost* host); 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) ~BootSplashScreen(); 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Begins animating |layer_|'s opacity to 0 over |duration|. 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void StartHideAnimation(base::TimeDelta duration); 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private: 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) class CopyHostContentLayerDelegate; 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Copies the host window's content to |layer_|. 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) scoped_ptr<CopyHostContentLayerDelegate> layer_delegate_; 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) scoped_ptr<ui::Layer> layer_; 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(BootSplashScreen); 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace ash 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 513551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)#endif // ASH_WM_BOOT_SPLASH_SCREEN_CHROMEOS_H_ 52