| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_DISPLAY_DISPLAY_ANIMATOR_CHROMEOS_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_ANIMATOR_CHROMEOS_H_ |
| 6 #define ASH_DISPLAY_DISPLAY_ANIMATOR_CHROMEOS_H_ | 6 #define ASH_DISPLAY_DISPLAY_ANIMATOR_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/display/display_animator.h" | 12 #include "ash/display/display_animator.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
| 17 #include "ui/display/manager/chromeos/display_configurator.h" | 17 #include "ui/display/manager/chromeos/display_configurator.h" |
| 18 | 18 |
| 19 namespace aura { | 19 namespace aura { |
| 20 class Window; | 20 class Window; |
| 21 } // namespace aura | 21 } // namespace aura |
| 22 | 22 |
| 23 namespace ui { | 23 namespace ui { |
| 24 class Layer; | 24 class Layer; |
| 25 } // namespace ui | 25 } // namespace ui |
| 26 | 26 |
| 27 namespace ash { | 27 namespace ash { |
| 28 | 28 |
| 29 // DisplayAnimatorChromeOS provides the visual effects for | 29 // DisplayAnimatorChromeOS provides the visual effects for |
| 30 // ui::DisplayConfigurator, such like fade-out/in during changing | 30 // display::DisplayConfigurator, such like fade-out/in during changing |
| 31 // the display mode. | 31 // the display mode. |
| 32 class ASH_EXPORT DisplayAnimatorChromeOS | 32 class ASH_EXPORT DisplayAnimatorChromeOS |
| 33 : public DisplayAnimator, | 33 : public DisplayAnimator, |
| 34 public ui::DisplayConfigurator::Observer { | 34 public display::DisplayConfigurator::Observer { |
| 35 public: | 35 public: |
| 36 DisplayAnimatorChromeOS(); | 36 DisplayAnimatorChromeOS(); |
| 37 ~DisplayAnimatorChromeOS() override; | 37 ~DisplayAnimatorChromeOS() override; |
| 38 | 38 |
| 39 // DisplayAnimator | 39 // DisplayAnimator |
| 40 void StartFadeOutAnimation(base::Closure callback) override; | 40 void StartFadeOutAnimation(base::Closure callback) override; |
| 41 void StartFadeInAnimation() override; | 41 void StartFadeInAnimation() override; |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 // ui::DisplayConfigurator::Observer overrides: | 44 // display::DisplayConfigurator::Observer overrides: |
| 45 void OnDisplayModeChanged( | 45 void OnDisplayModeChanged( |
| 46 const ui::DisplayConfigurator::DisplayStateList& outputs) override; | 46 const display::DisplayConfigurator::DisplayStateList& outputs) override; |
| 47 void OnDisplayModeChangeFailed( | 47 void OnDisplayModeChangeFailed( |
| 48 const ui::DisplayConfigurator::DisplayStateList& displays, | 48 const display::DisplayConfigurator::DisplayStateList& displays, |
| 49 ui::MultipleDisplayState failed_new_state) override; | 49 display::MultipleDisplayState failed_new_state) override; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // Clears all hiding layers. Note that in case that this method is called | 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 | 53 // during an animation, the method call will cancel all of the animations |
| 54 // and *not* call the registered callback. | 54 // and *not* call the registered callback. |
| 55 void ClearHidingLayers(); | 55 void ClearHidingLayers(); |
| 56 | 56 |
| 57 std::map<aura::Window*, std::unique_ptr<ui::Layer>> hiding_layers_; | 57 std::map<aura::Window*, std::unique_ptr<ui::Layer>> hiding_layers_; |
| 58 std::unique_ptr<base::OneShotTimer> timer_; | 58 std::unique_ptr<base::OneShotTimer> timer_; |
| 59 base::WeakPtrFactory<DisplayAnimatorChromeOS> weak_ptr_factory_; | 59 base::WeakPtrFactory<DisplayAnimatorChromeOS> weak_ptr_factory_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(DisplayAnimatorChromeOS); | 61 DISALLOW_COPY_AND_ASSIGN(DisplayAnimatorChromeOS); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace ash | 64 } // namespace ash |
| 65 | 65 |
| 66 #endif // ASH_DISPLAY_DISPLAY_ANIMATOR_CHROMEOS_H_ | 66 #endif // ASH_DISPLAY_DISPLAY_ANIMATOR_CHROMEOS_H_ |
| OLD | NEW |