1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_DISPLAY_OUTPUT_CONFIGURATOR_ANIMATION_H_
6 #define ASH_DISPLAY_OUTPUT_CONFIGURATOR_ANIMATION_H_
10 #include "ash/ash_export.h"
11 #include "base/callback.h"
12 #include "base/timer/timer.h"
13 #include "chromeos/display/output_configurator.h"
26 // OutputConfiguratorAnimation provides the visual effects for
27 // chromeos::OutputConfigurator, such like fade-out/in during changing
29 class ASH_EXPORT OutputConfiguratorAnimation
30 : public chromeos::OutputConfigurator::Observer
{
32 OutputConfiguratorAnimation();
33 virtual ~OutputConfiguratorAnimation();
35 // Starts the fade-out animation for the all root windows. It will
36 // call |callback| once all of the animations have finished.
37 void StartFadeOutAnimation(base::Closure callback
);
39 // Starts the animation to clear the fade-out animation effect
40 // for the all root windows.
41 void StartFadeInAnimation();
44 // chromeos::OutputConfigurator::Observer overrides:
45 virtual void OnDisplayModeChanged() OVERRIDE
;
46 virtual void OnDisplayModeChangeFailed(
47 chromeos::OutputState failed_new_state
) OVERRIDE
;
50 // Clears all hiding layers. Note that in case that this method is called
51 // during an animation, the method call will cancel all of the animations
52 // and *not* call the registered callback.
53 void ClearHidingLayers();
55 std::map
<aura::RootWindow
*, ui::Layer
*> hiding_layers_
;
56 scoped_ptr
<base::OneShotTimer
<OutputConfiguratorAnimation
> > timer_
;
58 DISALLOW_COPY_AND_ASSIGN(OutputConfiguratorAnimation
);
61 } // namespace internal
64 #endif // ASH_DISPLAY_OUTPUT_CONFIGURATION_CONTROLLER_H_