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

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

Issue 138003007: [Cleanup] Screen cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make sure screen_for_shutdown is reset everytime Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ash/display/display_controller_unittest.cc ('k') | ash/display/display_manager.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 (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_MANAGER_H_ 5 #ifndef ASH_DISPLAY_DISPLAY_MANAGER_H_
6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ 6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/display/display_info.h" 12 #include "ash/display/display_info.h"
13 #include "ash/display/display_layout.h" 13 #include "ash/display/display_layout.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "ui/gfx/display.h" 17 #include "ui/gfx/display.h"
18 18
19 #if defined(OS_CHROMEOS) 19 #if defined(OS_CHROMEOS)
20 #include "chromeos/display/output_configurator.h" 20 #include "chromeos/display/output_configurator.h"
21 #endif 21 #endif
22 22
23 namespace gfx { 23 namespace gfx {
24 class Display; 24 class Display;
25 class Insets; 25 class Insets;
26 class Rect; 26 class Rect;
27 class Screen;
27 } 28 }
28 29
29 namespace ash { 30 namespace ash {
30 class AcceleratorControllerTest; 31 class AcceleratorControllerTest;
31 class DisplayController; 32 class DisplayController;
33 class ScreenAsh;
32 34
33 namespace test { 35 namespace test {
34 class DisplayManagerTestApi; 36 class DisplayManagerTestApi;
35 class SystemGestureEventFilterTest; 37 class SystemGestureEventFilterTest;
36 } 38 }
37 namespace internal { 39 namespace internal {
38 class DisplayLayoutStore; 40 class DisplayLayoutStore;
39 41
40 // DisplayManager maintains the current display configurations, 42 // DisplayManager maintains the current display configurations,
41 // and notifies observers when configuration changes. 43 // and notifies observers when configuration changes.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 const gfx::Display& primary_display, 93 const gfx::Display& primary_display,
92 int64 secondary_display_id); 94 int64 secondary_display_id);
93 95
94 DisplayManager(); 96 DisplayManager();
95 virtual ~DisplayManager(); 97 virtual ~DisplayManager();
96 98
97 DisplayLayoutStore* layout_store() { 99 DisplayLayoutStore* layout_store() {
98 return layout_store_.get(); 100 return layout_store_.get();
99 } 101 }
100 102
103 gfx::Screen* screen() {
104 return screen_;
105 }
106
101 void set_delegate(Delegate* delegate) { delegate_ = delegate; } 107 void set_delegate(Delegate* delegate) { delegate_ = delegate; }
102 108
103 // When set to true, the MonitorManager calls OnDisplayBoundsChanged 109 // When set to true, the MonitorManager calls OnDisplayBoundsChanged
104 // even if the display's bounds didn't change. Used to swap primary 110 // even if the display's bounds didn't change. Used to swap primary
105 // display. 111 // display.
106 void set_force_bounds_changed(bool force_bounds_changed) { 112 void set_force_bounds_changed(bool force_bounds_changed) {
107 force_bounds_changed_ = force_bounds_changed; 113 force_bounds_changed_ = force_bounds_changed;
108 } 114 }
109 115
110 // Returns the display id of the first display in the outupt list. 116 // Returns the display id of the first display in the outupt list.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 264 }
259 265
260 // Update the bounds of the display given by |display_id|. 266 // Update the bounds of the display given by |display_id|.
261 bool UpdateDisplayBounds(int64 display_id, 267 bool UpdateDisplayBounds(int64 display_id,
262 const gfx::Rect& new_bounds); 268 const gfx::Rect& new_bounds);
263 269
264 // Creates mirror window if the software mirror mode is enabled. 270 // Creates mirror window if the software mirror mode is enabled.
265 // This is used only for bootstrap. 271 // This is used only for bootstrap.
266 void CreateMirrorWindowIfAny(); 272 void CreateMirrorWindowIfAny();
267 273
274 // Create a screen instance to be used during shutdown.
275 void CreateScreenForShutdown() const;
276
268 private: 277 private:
269 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); 278 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint);
270 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, TestNativeDisplaysChanged); 279 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, TestNativeDisplaysChanged);
271 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, 280 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest,
272 NativeDisplaysChangedAfterPrimaryChange); 281 NativeDisplaysChangedAfterPrimaryChange);
273 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, AutomaticOverscanInsets); 282 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, AutomaticOverscanInsets);
274 friend class ash::AcceleratorControllerTest; 283 friend class ash::AcceleratorControllerTest;
275 friend class test::DisplayManagerTestApi; 284 friend class test::DisplayManagerTestApi;
276 friend class test::SystemGestureEventFilterTest; 285 friend class test::SystemGestureEventFilterTest;
277 friend class DisplayManagerTest; 286 friend class DisplayManagerTest;
(...skipping 28 matching lines...) Expand all
306 bool UpdateSecondaryDisplayBoundsForLayout(DisplayList* display_list, 315 bool UpdateSecondaryDisplayBoundsForLayout(DisplayList* display_list,
307 size_t* updated_index) const; 316 size_t* updated_index) const;
308 317
309 static void UpdateDisplayBoundsForLayout( 318 static void UpdateDisplayBoundsForLayout(
310 const DisplayLayout& layout, 319 const DisplayLayout& layout,
311 const gfx::Display& primary_display, 320 const gfx::Display& primary_display,
312 gfx::Display* secondary_display); 321 gfx::Display* secondary_display);
313 322
314 Delegate* delegate_; // not owned. 323 Delegate* delegate_; // not owned.
315 324
325 scoped_ptr<ScreenAsh> screen_ash_;
326 // This is to have an accessor without ScreenAsh definition.
327 gfx::Screen* screen_;
328
316 scoped_ptr<DisplayLayoutStore> layout_store_; 329 scoped_ptr<DisplayLayoutStore> layout_store_;
317 330
318 int64 first_display_id_; 331 int64 first_display_id_;
319 332
320 // List of current active displays. 333 // List of current active displays.
321 DisplayList displays_; 334 DisplayList displays_;
322 335
323 int num_connected_displays_; 336 int num_connected_displays_;
324 337
325 bool force_bounds_changed_; 338 bool force_bounds_changed_;
(...skipping 15 matching lines...) Expand all
341 int64 mirrored_display_id_; 354 int64 mirrored_display_id_;
342 gfx::Display non_desktop_display_; 355 gfx::Display non_desktop_display_;
343 356
344 DISALLOW_COPY_AND_ASSIGN(DisplayManager); 357 DISALLOW_COPY_AND_ASSIGN(DisplayManager);
345 }; 358 };
346 359
347 } // namespace internal 360 } // namespace internal
348 } // namespace ash 361 } // namespace ash
349 362
350 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ 363 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/display/display_controller_unittest.cc ('k') | ash/display/display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698