OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CONFIGURATION_CONTROLLER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_ |
6 #define ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_ | 6 #define ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "ash/display/window_tree_host_manager.h" | 11 #include "ash/display/window_tree_host_manager.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "ui/display/display.h" | 14 #include "ui/display/display.h" |
15 | 15 |
16 namespace display { | 16 namespace display { |
17 class DisplayLayout; | 17 class DisplayLayout; |
| 18 class DisplayManager; |
18 } | 19 } |
19 | 20 |
20 namespace ash { | 21 namespace ash { |
21 | 22 |
22 namespace test { | 23 namespace test { |
23 class ShellTestApi; | 24 class ShellTestApi; |
24 } // namespace test | 25 } // namespace test |
25 | 26 |
26 class DisplayAnimator; | 27 class DisplayAnimator; |
27 class DisplayManager; | |
28 | 28 |
29 // This class controls Display related configuration. Specifically it: | 29 // This class controls Display related configuration. Specifically it: |
30 // * Handles animated transitions where appropriate. | 30 // * Handles animated transitions where appropriate. |
31 // * Limits the frequency of certain operations. | 31 // * Limits the frequency of certain operations. |
32 // * Provides a single interface for UI and API classes. | 32 // * Provides a single interface for UI and API classes. |
33 // * TODO: Forwards display configuration changed events to UI and API classes. | 33 // * TODO: Forwards display configuration changed events to UI and API classes. |
34 class ASH_EXPORT DisplayConfigurationController | 34 class ASH_EXPORT DisplayConfigurationController |
35 : public WindowTreeHostManager::Observer { | 35 : public WindowTreeHostManager::Observer { |
36 public: | 36 public: |
37 DisplayConfigurationController( | 37 DisplayConfigurationController( |
38 DisplayManager* display_manager, | 38 display::DisplayManager* display_manager, |
39 WindowTreeHostManager* window_tree_host_manager); | 39 WindowTreeHostManager* window_tree_host_manager); |
40 ~DisplayConfigurationController() override; | 40 ~DisplayConfigurationController() override; |
41 | 41 |
42 // Sets the layout for the current displays with a fade in/out | 42 // Sets the layout for the current displays with a fade in/out |
43 // animation. Currently |display_id| is assumed to be the secondary | 43 // animation. Currently |display_id| is assumed to be the secondary |
44 // display. TODO(oshima/stevenjb): Support 3+ displays. | 44 // display. TODO(oshima/stevenjb): Support 3+ displays. |
45 void SetDisplayLayout(std::unique_ptr<display::DisplayLayout> layout, | 45 void SetDisplayLayout(std::unique_ptr<display::DisplayLayout> layout, |
46 bool user_action); | 46 bool user_action); |
47 | 47 |
48 // Sets the mirror mode with a fade-in/fade-out animation. Affects all | 48 // Sets the mirror mode with a fade-in/fade-out animation. Affects all |
(...skipping 22 matching lines...) Expand all Loading... |
71 class DisplayChangeLimiter; | 71 class DisplayChangeLimiter; |
72 | 72 |
73 // Sets the timeout for the DisplayChangeLimiter if it exists. Call this | 73 // Sets the timeout for the DisplayChangeLimiter if it exists. Call this |
74 // *before* starting any animations. | 74 // *before* starting any animations. |
75 void SetThrottleTimeout(int64_t throttle_ms); | 75 void SetThrottleTimeout(int64_t throttle_ms); |
76 bool IsLimited(); | 76 bool IsLimited(); |
77 void SetDisplayLayoutImpl(std::unique_ptr<display::DisplayLayout> layout); | 77 void SetDisplayLayoutImpl(std::unique_ptr<display::DisplayLayout> layout); |
78 void SetMirrorModeImpl(bool mirror); | 78 void SetMirrorModeImpl(bool mirror); |
79 void SetPrimaryDisplayIdImpl(int64_t display_id); | 79 void SetPrimaryDisplayIdImpl(int64_t display_id); |
80 | 80 |
81 DisplayManager* display_manager_; // weak ptr | 81 display::DisplayManager* display_manager_; // weak ptr |
82 WindowTreeHostManager* window_tree_host_manager_; // weak ptr | 82 WindowTreeHostManager* window_tree_host_manager_; // weak ptr |
83 std::unique_ptr<DisplayAnimator> display_animator_; | 83 std::unique_ptr<DisplayAnimator> display_animator_; |
84 std::unique_ptr<DisplayChangeLimiter> limiter_; | 84 std::unique_ptr<DisplayChangeLimiter> limiter_; |
85 | 85 |
86 base::WeakPtrFactory<DisplayConfigurationController> weak_ptr_factory_; | 86 base::WeakPtrFactory<DisplayConfigurationController> weak_ptr_factory_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurationController); | 88 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurationController); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace ash | 91 } // namespace ash |
92 | 92 |
93 #endif // ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_ | 93 #endif // ASH_DISPLAY_DISPLAY_CONFIGURATION_CONTROLLER_H_ |
OLD | NEW |