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

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

Issue 1107733006: Unified Desktop: hook up ash to allow unified desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_CONTROLLER_H_ 5 #ifndef ASH_DISPLAY_DISPLAY_CONTROLLER_H_
6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ 6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Add/Remove observers. 99 // Add/Remove observers.
100 void AddObserver(Observer* observer); 100 void AddObserver(Observer* observer);
101 void RemoveObserver(Observer* observer); 101 void RemoveObserver(Observer* observer);
102 102
103 // Returns the root window for primary display. 103 // Returns the root window for primary display.
104 aura::Window* GetPrimaryRootWindow(); 104 aura::Window* GetPrimaryRootWindow();
105 105
106 // Returns the root window for |display_id|. 106 // Returns the root window for |display_id|.
107 aura::Window* GetRootWindowForDisplayId(int64 id); 107 aura::Window* GetRootWindowForDisplayId(int64 id);
108 108
109 AshWindowTreeHost* GetAshWindowTreeHostForDisplayId(int64 id);
110
109 // Toggle mirror mode. 111 // Toggle mirror mode.
110 void ToggleMirrorMode(); 112 void ToggleMirrorMode();
111 113
112 // Swap primary and secondary display. 114 // Swap primary and secondary display.
113 void SwapPrimaryDisplay(); 115 void SwapPrimaryDisplay();
114 116
115 // Sets the ID of the primary display. If the display is not connected, it 117 // Sets the ID of the primary display. If the display is not connected, it
116 // will switch the primary display when connected. 118 // will switch the primary display when connected.
117 void SetPrimaryDisplayId(int64 id); 119 void SetPrimaryDisplayId(int64 id);
118 120
(...skipping 27 matching lines...) Expand all
146 // gfx::DisplayObserver overrides: 148 // gfx::DisplayObserver overrides:
147 void OnDisplayAdded(const gfx::Display& display) override; 149 void OnDisplayAdded(const gfx::Display& display) override;
148 void OnDisplayRemoved(const gfx::Display& display) override; 150 void OnDisplayRemoved(const gfx::Display& display) override;
149 void OnDisplayMetricsChanged(const gfx::Display& display, 151 void OnDisplayMetricsChanged(const gfx::Display& display,
150 uint32_t metrics) override; 152 uint32_t metrics) override;
151 153
152 // aura::WindowTreeHostObserver overrides: 154 // aura::WindowTreeHostObserver overrides:
153 void OnHostResized(const aura::WindowTreeHost* host) override; 155 void OnHostResized(const aura::WindowTreeHost* host) override;
154 156
155 // aura::DisplayManager::Delegate overrides: 157 // aura::DisplayManager::Delegate overrides:
156 void CreateOrUpdateMirroringDisplay(const DisplayInfo& info) override; 158 void CreateOrUpdateMirroringDisplay(
159 const DisplayInfoList& info_list) override;
157 void CloseMirroringDisplay() override; 160 void CloseMirroringDisplay() override;
158 void PreDisplayConfigurationChange(bool clear_focus) override; 161 void PreDisplayConfigurationChange(bool clear_focus) override;
159 void PostDisplayConfigurationChange() override; 162 void PostDisplayConfigurationChange() override;
160 163
161 private: 164 private:
162 FRIEND_TEST_ALL_PREFIXES(DisplayControllerTest, BoundsUpdated); 165 FRIEND_TEST_ALL_PREFIXES(DisplayControllerTest, BoundsUpdated);
163 FRIEND_TEST_ALL_PREFIXES(DisplayControllerTest, SecondaryDisplayLayout); 166 FRIEND_TEST_ALL_PREFIXES(DisplayControllerTest, SecondaryDisplayLayout);
164 friend class DisplayManager; 167 friend class DisplayManager;
165 friend class MirrorWindowController; 168 friend class MirrorWindowController;
166 169
167 // Creates a WindowTreeHost for |display| and stores it in the 170 // Creates a WindowTreeHost for |display| and stores it in the
168 // |window_tree_hosts_| map. 171 // |window_tree_hosts_| map.
169 AshWindowTreeHost* AddWindowTreeHostForDisplay( 172 AshWindowTreeHost* AddWindowTreeHostForDisplay(
170 const gfx::Display& display, 173 const gfx::Display& display,
171 const AshWindowTreeHostInitParams& params); 174 const AshWindowTreeHostInitParams& params);
172 175
173 void OnFadeOutForSwapDisplayFinished(); 176 void OnFadeOutForSwapDisplayFinished();
174 177
175 void SetMirrorModeAfterAnimation(bool mirror); 178 void SetMirrorModeAfterAnimation(bool mirror);
176 179
180 // Delete the AsWindowTreeHost. This does not remove the entry from
181 // |window_tree_hosts_|. Caller has to explicitly remove it.
182 void DeleteHost(AshWindowTreeHost* host_to_delete);
183
177 class DisplayChangeLimiter { 184 class DisplayChangeLimiter {
178 public: 185 public:
179 DisplayChangeLimiter(); 186 DisplayChangeLimiter();
180 187
181 // Sets how long the throttling should last. 188 // Sets how long the throttling should last.
182 void SetThrottleTimeout(int64 throttle_ms); 189 void SetThrottleTimeout(int64 throttle_ms);
183 190
184 bool IsThrottled() const; 191 bool IsThrottled() const;
185 192
186 private: 193 private:
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 int64 cursor_display_id_for_restore_; 228 int64 cursor_display_id_for_restore_;
222 229
223 base::WeakPtrFactory<DisplayController> weak_ptr_factory_; 230 base::WeakPtrFactory<DisplayController> weak_ptr_factory_;
224 231
225 DISALLOW_COPY_AND_ASSIGN(DisplayController); 232 DISALLOW_COPY_AND_ASSIGN(DisplayController);
226 }; 233 };
227 234
228 } // namespace ash 235 } // namespace ash
229 236
230 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ 237 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698