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

Side by Side Diff: ash/display/display_animator_chromeos.h

Issue 1594683002: Introduce DisplayConfigurationController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_576375_display1b1
Patch Set: Rebase Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « ash/display/display_animator.cc ('k') | ash/display/display_animator_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_H_ 5 #ifndef ASH_DISPLAY_DISPLAY_ANIMATOR_CHROMEOS_H_
6 #define ASH_DISPLAY_DISPLAY_ANIMATOR_H_ 6 #define ASH_DISPLAY_DISPLAY_ANIMATOR_CHROMEOS_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/display/display_animator.h"
11 #include "base/callback.h" 12 #include "base/callback.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
14 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
15 #include "ui/display/chromeos/display_configurator.h" 16 #include "ui/display/chromeos/display_configurator.h"
16 17
17 namespace aura { 18 namespace aura {
18 class RootWindow; 19 class RootWindow;
19 class Window; 20 class Window;
20 } // namespace aura 21 } // namespace aura
21 22
22 namespace ui { 23 namespace ui {
23 class Layer; 24 class Layer;
24 } // namespace ui 25 } // namespace ui
25 26
26 namespace ash { 27 namespace ash {
27 28
28 // DisplayAnimator provides the visual effects for 29 // DisplayAnimatorChromeOS provides the visual effects for
29 // ui::DisplayConfigurator, such like fade-out/in during changing 30 // ui::DisplayConfigurator, such like fade-out/in during changing
30 // the display mode. 31 // the display mode.
31 class ASH_EXPORT DisplayAnimator : public ui::DisplayConfigurator::Observer { 32 class ASH_EXPORT DisplayAnimatorChromeOS
33 : public DisplayAnimator,
34 public ui::DisplayConfigurator::Observer {
32 public: 35 public:
33 DisplayAnimator(); 36 DisplayAnimatorChromeOS();
34 ~DisplayAnimator() override; 37 ~DisplayAnimatorChromeOS() override;
35 38
36 // Starts the fade-out animation for the all root windows. It will 39 // DisplayAnimator
37 // call |callback| once all of the animations have finished. 40 void StartFadeOutAnimation(base::Closure callback) override;
38 void StartFadeOutAnimation(base::Closure callback); 41 void StartFadeInAnimation() override;
39
40 // Starts the animation to clear the fade-out animation effect
41 // for the all root windows.
42 void StartFadeInAnimation();
43 42
44 protected: 43 protected:
45 // ui::DisplayConfigurator::Observer overrides: 44 // ui::DisplayConfigurator::Observer overrides:
46 void OnDisplayModeChanged( 45 void OnDisplayModeChanged(
47 const ui::DisplayConfigurator::DisplayStateList& outputs) override; 46 const ui::DisplayConfigurator::DisplayStateList& outputs) override;
48 void OnDisplayModeChangeFailed( 47 void OnDisplayModeChangeFailed(
49 const ui::DisplayConfigurator::DisplayStateList& displays, 48 const ui::DisplayConfigurator::DisplayStateList& displays,
50 ui::MultipleDisplayState failed_new_state) override; 49 ui::MultipleDisplayState failed_new_state) override;
51 50
52 private: 51 private:
53 // 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
54 // 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
55 // and *not* call the registered callback. 54 // and *not* call the registered callback.
56 void ClearHidingLayers(); 55 void ClearHidingLayers();
57 56
58 std::map<aura::Window*, ui::Layer*> hiding_layers_; 57 std::map<aura::Window*, ui::Layer*> hiding_layers_;
59 scoped_ptr<base::OneShotTimer> timer_; 58 scoped_ptr<base::OneShotTimer> timer_;
60 base::WeakPtrFactory<DisplayAnimator> weak_ptr_factory_; 59 base::WeakPtrFactory<DisplayAnimatorChromeOS> weak_ptr_factory_;
61 60
62 DISALLOW_COPY_AND_ASSIGN(DisplayAnimator); 61 DISALLOW_COPY_AND_ASSIGN(DisplayAnimatorChromeOS);
63 }; 62 };
64 63
65 } // namespace ash 64 } // namespace ash
66 65
67 #endif // ASH_DISPLAY_DISPLAY_ANIMATOR_H_ 66 #endif // ASH_DISPLAY_DISPLAY_ANIMATOR_CHROMEOS_H_
OLDNEW
« no previous file with comments | « ash/display/display_animator.cc ('k') | ash/display/display_animator_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698