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 "ui/display/chromeos/output_configurator.h"
27 // OutputConfiguratorAnimation provides the visual effects for
28 // ui::OutputConfigurator, such like fade-out/in during changing
30 class ASH_EXPORT OutputConfiguratorAnimation
31 : public ui::OutputConfigurator::Observer {
33 OutputConfiguratorAnimation();
34 virtual ~OutputConfiguratorAnimation();
36 // Starts the fade-out animation for the all root windows. It will
37 // call |callback| once all of the animations have finished.
38 void StartFadeOutAnimation(base::Closure callback);
40 // Starts the animation to clear the fade-out animation effect
41 // for the all root windows.
42 void StartFadeInAnimation();
45 // ui::OutputConfigurator::Observer overrides:
46 virtual void OnDisplayModeChanged(
47 const ui::OutputConfigurator::DisplayStateList& outputs) OVERRIDE;
48 virtual void OnDisplayModeChangeFailed(ui::OutputState failed_new_state)
52 // Clears all hiding layers. Note that in case that this method is called
53 // during an animation, the method call will cancel all of the animations
54 // and *not* call the registered callback.
55 void ClearHidingLayers();
57 std::map<aura::Window*, ui::Layer*> hiding_layers_;
58 scoped_ptr<base::OneShotTimer<OutputConfiguratorAnimation> > timer_;
60 DISALLOW_COPY_AND_ASSIGN(OutputConfiguratorAnimation);
63 } // namespace internal
66 #endif // ASH_DISPLAY_OUTPUT_CONFIGURATION_CONTROLLER_H_