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

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

Issue 2196923002: Make ash::DisplayMode more like ui::DisplayMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 4 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_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 <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "ash/ash_export.h" 15 #include "ash/ash_export.h"
16 #include "ash/common/display/display_info.h" 16 #include "ash/common/display/display_info.h"
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/gtest_prod_util.h" 18 #include "base/gtest_prod_util.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "base/memory/ref_counted.h"
20 #include "base/memory/weak_ptr.h" 21 #include "base/memory/weak_ptr.h"
21 #include "ui/display/display.h" 22 #include "ui/display/display.h"
22 #include "ui/display/manager/display_layout.h" 23 #include "ui/display/manager/display_layout.h"
23 24
24 #if defined(OS_CHROMEOS) 25 #if defined(OS_CHROMEOS)
25 #include "ui/display/chromeos/display_configurator.h" 26 #include "ui/display/chromeos/display_configurator.h"
26 #endif 27 #endif
27 28
28 namespace aura { 29 namespace aura {
29 class Window; 30 class Window;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // Sets the display's rotation for the given |source|. The new |rotation| will 158 // Sets the display's rotation for the given |source|. The new |rotation| will
158 // also become active. 159 // also become active.
159 void SetDisplayRotation(int64_t display_id, 160 void SetDisplayRotation(int64_t display_id,
160 display::Display::Rotation rotation, 161 display::Display::Rotation rotation,
161 display::Display::RotationSource source); 162 display::Display::RotationSource source);
162 163
163 // Sets the external display's configuration, including resolution change, 164 // Sets the external display's configuration, including resolution change,
164 // ui-scale change, and device scale factor change. Returns true if it changes 165 // ui-scale change, and device scale factor change. Returns true if it changes
165 // the display resolution so that the caller needs to show a notification in 166 // the display resolution so that the caller needs to show a notification in
166 // case the new resolution actually doesn't work. 167 // case the new resolution actually doesn't work.
167 bool SetDisplayMode(int64_t display_id, const DisplayMode& display_mode); 168 bool SetDisplayMode(int64_t display_id,
169 const scoped_refptr<DisplayMode>& display_mode);
168 170
169 // Register per display properties. |overscan_insets| is NULL if 171 // Register per display properties. |overscan_insets| is NULL if
170 // the display has no custom overscan insets. 172 // the display has no custom overscan insets.
171 void RegisterDisplayProperty(int64_t display_id, 173 void RegisterDisplayProperty(int64_t display_id,
172 display::Display::Rotation rotation, 174 display::Display::Rotation rotation,
173 float ui_scale, 175 float ui_scale,
174 const gfx::Insets* overscan_insets, 176 const gfx::Insets* overscan_insets,
175 const gfx::Size& resolution_in_pixels, 177 const gfx::Size& resolution_in_pixels,
176 float device_scale_factor, 178 float device_scale_factor,
177 ui::ColorCalibrationProfile color_profile); 179 ui::ColorCalibrationProfile color_profile);
178 180
179 // Register stored rotation properties for the internal display. 181 // Register stored rotation properties for the internal display.
180 void RegisterDisplayRotationProperties(bool rotation_lock, 182 void RegisterDisplayRotationProperties(bool rotation_lock,
181 display::Display::Rotation rotation); 183 display::Display::Rotation rotation);
182 184
183 // Returns the stored rotation lock preference if it has been loaded, 185 // Returns the stored rotation lock preference if it has been loaded,
184 // otherwise false. 186 // otherwise false.
185 bool registered_internal_display_rotation_lock() const { 187 bool registered_internal_display_rotation_lock() const {
186 return registered_internal_display_rotation_lock_; 188 return registered_internal_display_rotation_lock_;
187 } 189 }
188 190
189 // Returns the stored rotation preference for the internal display if it has 191 // Returns the stored rotation preference for the internal display if it has
190 // been loaded, otherwise |display::Display::Rotate_0|. 192 // been loaded, otherwise |display::Display::Rotate_0|.
191 display::Display::Rotation registered_internal_display_rotation() const { 193 display::Display::Rotation registered_internal_display_rotation() const {
192 return registered_internal_display_rotation_; 194 return registered_internal_display_rotation_;
193 } 195 }
194 196
195 // Returns the display mode of |display_id| which is currently used. 197 // Returns the display mode of |display_id| which is currently used.
196 DisplayMode GetActiveModeForDisplayId(int64_t display_id) const; 198 scoped_refptr<DisplayMode> GetActiveModeForDisplayId(
199 int64_t display_id) const;
197 200
198 // Returns the display's selected mode. This returns false and doesn't 201 // Returns the display's selected mode. This returns false and doesn't
199 // set |mode_out| if the display mode is in default. 202 // set |mode_out| if the display mode is in default.
200 bool GetSelectedModeForDisplayId(int64_t display_id, 203 scoped_refptr<DisplayMode> GetSelectedModeForDisplayId(
201 DisplayMode* mode_out) const; 204 int64_t display_id) const;
202 205
203 // Tells if the virtual resolution feature is enabled. 206 // Tells if the virtual resolution feature is enabled.
204 bool IsDisplayUIScalingEnabled() const; 207 bool IsDisplayUIScalingEnabled() const;
205 208
206 // Returns the current overscan insets for the specified |display_id|. 209 // Returns the current overscan insets for the specified |display_id|.
207 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for 210 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for
208 // the display. 211 // the display.
209 gfx::Insets GetOverscanInsets(int64_t display_id) const; 212 gfx::Insets GetOverscanInsets(int64_t display_id) const;
210 213
211 // Sets the color calibration of the display to |profile|. 214 // Sets the color calibration of the display to |profile|.
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 display::DisplayList active_display_list_; 414 display::DisplayList active_display_list_;
412 415
413 int num_connected_displays_; 416 int num_connected_displays_;
414 417
415 bool force_bounds_changed_; 418 bool force_bounds_changed_;
416 419
417 // The mapping from the display ID to its internal data. 420 // The mapping from the display ID to its internal data.
418 std::map<int64_t, DisplayInfo> display_info_; 421 std::map<int64_t, DisplayInfo> display_info_;
419 422
420 // Selected display modes for displays. Key is the displays' ID. 423 // Selected display modes for displays. Key is the displays' ID.
421 std::map<int64_t, DisplayMode> display_modes_; 424 std::map<int64_t, scoped_refptr<DisplayMode>> display_modes_;
422 425
423 // When set to true, the host window's resize event updates 426 // When set to true, the host window's resize event updates
424 // the display's size. This is set to true when running on 427 // the display's size. This is set to true when running on
425 // desktop environment (for debugging) so that resizing the host 428 // desktop environment (for debugging) so that resizing the host
426 // window will update the display properly. This is set to false 429 // window will update the display properly. This is set to false
427 // on device as well as during the unit tests. 430 // on device as well as during the unit tests.
428 bool change_display_upon_host_resize_; 431 bool change_display_upon_host_resize_;
429 432
430 MultiDisplayMode multi_display_mode_; 433 MultiDisplayMode multi_display_mode_;
431 MultiDisplayMode current_default_multi_display_mode_; 434 MultiDisplayMode current_default_multi_display_mode_;
(...skipping 10 matching lines...) Expand all
442 bool unified_desktop_enabled_; 445 bool unified_desktop_enabled_;
443 446
444 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; 447 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_;
445 448
446 DISALLOW_COPY_AND_ASSIGN(DisplayManager); 449 DISALLOW_COPY_AND_ASSIGN(DisplayManager);
447 }; 450 };
448 451
449 } // namespace ash 452 } // namespace ash
450 453
451 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ 454 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698