OLD | NEW |
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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
| 11 #include <memory> |
11 #include <string> | 12 #include <string> |
12 #include <vector> | 13 #include <vector> |
13 | 14 |
14 #include "ash/ash_export.h" | 15 #include "ash/ash_export.h" |
15 #include "ash/display/display_info.h" | 16 #include "ash/display/display_info.h" |
16 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
17 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
18 #include "base/macros.h" | 19 #include "base/macros.h" |
19 #include "base/memory/scoped_ptr.h" | |
20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
21 #include "ui/display/manager/display_layout.h" | 21 #include "ui/display/manager/display_layout.h" |
22 #include "ui/gfx/display.h" | 22 #include "ui/gfx/display.h" |
23 | 23 |
24 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
25 #include "ui/display/chromeos/display_configurator.h" | 25 #include "ui/display/chromeos/display_configurator.h" |
26 #endif | 26 #endif |
27 | 27 |
28 namespace aura { | 28 namespace aura { |
29 class Window; | 29 class Window; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 void RefreshFontParams(); | 131 void RefreshFontParams(); |
132 | 132 |
133 // Returns the display layout used for current displays. | 133 // Returns the display layout used for current displays. |
134 const display::DisplayLayout& GetCurrentDisplayLayout() const; | 134 const display::DisplayLayout& GetCurrentDisplayLayout() const; |
135 | 135 |
136 // Returns the current display list. | 136 // Returns the current display list. |
137 display::DisplayIdList GetCurrentDisplayIdList() const; | 137 display::DisplayIdList GetCurrentDisplayIdList() const; |
138 | 138 |
139 // Sets the layout for the current display pair. The |layout| specifies | 139 // Sets the layout for the current display pair. The |layout| specifies |
140 // the locaion of the displays relative to their parents. | 140 // the locaion of the displays relative to their parents. |
141 void SetLayoutForCurrentDisplays(scoped_ptr<display::DisplayLayout> layout); | 141 void SetLayoutForCurrentDisplays( |
| 142 std::unique_ptr<display::DisplayLayout> layout); |
142 | 143 |
143 // Returns display for given |id|; | 144 // Returns display for given |id|; |
144 const gfx::Display& GetDisplayForId(int64_t id) const; | 145 const gfx::Display& GetDisplayForId(int64_t id) const; |
145 | 146 |
146 // Finds the display that contains |point| in screeen coordinates. | 147 // Finds the display that contains |point| in screeen coordinates. |
147 // Returns invalid display if there is no display that can satisfy | 148 // Returns invalid display if there is no display that can satisfy |
148 // the condition. | 149 // the condition. |
149 const gfx::Display& FindDisplayContainingPoint( | 150 const gfx::Display& FindDisplayContainingPoint( |
150 const gfx::Point& point_in_screen) const; | 151 const gfx::Point& point_in_screen) const; |
151 | 152 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // Update the bounds of the display given by |display_id|. | 311 // Update the bounds of the display given by |display_id|. |
311 bool UpdateDisplayBounds(int64_t display_id, const gfx::Rect& new_bounds); | 312 bool UpdateDisplayBounds(int64_t display_id, const gfx::Rect& new_bounds); |
312 | 313 |
313 // Creates mirror window asynchronously if the software mirror mode | 314 // Creates mirror window asynchronously if the software mirror mode |
314 // is enabled. | 315 // is enabled. |
315 void CreateMirrorWindowAsyncIfAny(); | 316 void CreateMirrorWindowAsyncIfAny(); |
316 | 317 |
317 // Creates a MouseWarpController for the current display | 318 // Creates a MouseWarpController for the current display |
318 // configuration. |drag_source| is the window where dragging | 319 // configuration. |drag_source| is the window where dragging |
319 // started, or nullptr otherwise. | 320 // started, or nullptr otherwise. |
320 scoped_ptr<MouseWarpController> CreateMouseWarpController( | 321 std::unique_ptr<MouseWarpController> CreateMouseWarpController( |
321 aura::Window* drag_source) const; | 322 aura::Window* drag_source) const; |
322 | 323 |
323 // Create a screen instance to be used during shutdown. | 324 // Create a screen instance to be used during shutdown. |
324 void CreateScreenForShutdown() const; | 325 void CreateScreenForShutdown() const; |
325 | 326 |
326 // A unit test may change the internal display id (which never happens on | 327 // A unit test may change the internal display id (which never happens on |
327 // a real device). This will update the mode list for internal display | 328 // a real device). This will update the mode list for internal display |
328 // for this test scenario. | 329 // for this test scenario. |
329 void UpdateInternalDisplayModeListForTest(); | 330 void UpdateInternalDisplayModeListForTest(); |
330 | 331 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 display::DisplayList* display_list, | 403 display::DisplayList* display_list, |
403 std::vector<int64_t>* updated_ids); | 404 std::vector<int64_t>* updated_ids); |
404 | 405 |
405 // Apply the display placement to the display layout. | 406 // Apply the display placement to the display layout. |
406 // Returns true if the display bounds has been updated. | 407 // Returns true if the display bounds has been updated. |
407 bool ApplyDisplayPlacement(const display::DisplayPlacement& placement, | 408 bool ApplyDisplayPlacement(const display::DisplayPlacement& placement, |
408 display::DisplayList* display_list); | 409 display::DisplayList* display_list); |
409 | 410 |
410 Delegate* delegate_; // not owned. | 411 Delegate* delegate_; // not owned. |
411 | 412 |
412 scoped_ptr<ScreenAsh> screen_; | 413 std::unique_ptr<ScreenAsh> screen_; |
413 | 414 |
414 scoped_ptr<DisplayLayoutStore> layout_store_; | 415 std::unique_ptr<DisplayLayoutStore> layout_store_; |
415 | 416 |
416 int64_t first_display_id_; | 417 int64_t first_display_id_; |
417 | 418 |
418 // List of current active displays. | 419 // List of current active displays. |
419 display::DisplayList active_display_list_; | 420 display::DisplayList active_display_list_; |
420 | 421 |
421 int num_connected_displays_; | 422 int num_connected_displays_; |
422 | 423 |
423 bool force_bounds_changed_; | 424 bool force_bounds_changed_; |
424 | 425 |
(...skipping 25 matching lines...) Expand all Loading... |
450 bool unified_desktop_enabled_; | 451 bool unified_desktop_enabled_; |
451 | 452 |
452 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; | 453 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; |
453 | 454 |
454 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 455 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
455 }; | 456 }; |
456 | 457 |
457 } // namespace ash | 458 } // namespace ash |
458 | 459 |
459 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 460 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
OLD | NEW |