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

Unified Diff: ash/display/output_configurator_animation.h

Issue 10817028: Add Fade-out/Fade-in animation during output-configuration change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
Index: ash/display/output_configurator_animation.h
diff --git a/ash/display/output_configurator_animation.h b/ash/display/output_configurator_animation.h
new file mode 100644
index 0000000000000000000000000000000000000000..e3713d874c930552102a838489a40a23e1ba38af
--- /dev/null
+++ b/ash/display/output_configurator_animation.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_DISPLAY_OUTPUT_CONFIGURATOR_ANIMATION_H_
+#define ASH_DISPLAY_OUTPUT_CONFIGURATOR_ANIMATION_H_
+
+#include <map>
+
+#include "base/callback.h"
+#include "base/timer.h"
+#include "chromeos/display/output_configurator.h"
+
+namespace aura {
+class RootWindow;
+} // namespace aura
+
+namespace ui {
+class Layer;
+} // namespace ui
+
+namespace ash {
+namespace internal {
+
+// OutputConfiguratorAnimation provides the visual effects for
+// chromeos::OutputConfigurator, such like fade-out/in during changing
+// the display mode.
+class OutputConfiguratorAnimation
+ : public chromeos::OutputConfigurator::AnimationDelegate {
+ public:
+ OutputConfiguratorAnimation();
+ virtual ~OutputConfiguratorAnimation();
+
+ protected:
+ // chromeos::OutputConfigurator::AnimationDelegate overrides:
+ virtual void WillDisplayModeChange(base::Closure callback) OVERRIDE;
+ virtual void OnDisplayModeChanged() OVERRIDE;
+
+ private:
+ // Clears all hiding layers. Note that in case that this method is called
+ // during an animation, the method call will cancel all of the animations
+ // and *not* call the registered callback.
+ void ClearHidingLayers();
+
+ std::map<aura::RootWindow*, ui::Layer*> hiding_layers_;
+ scoped_ptr<base::OneShotTimer<OutputConfiguratorAnimation> > timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(OutputConfiguratorAnimation);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_DISPLAY_OUTPUT_CONFIGURATION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698