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

Side by Side Diff: ui/display/chromeos/display_configurator.h

Issue 615133002: Add support for a virtual display on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on ToT Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ 5 #ifndef UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_
6 #define UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ 6 #define UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/event_types.h" 14 #include "base/event_types.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "base/observer_list.h" 17 #include "base/observer_list.h"
18 #include "base/timer/timer.h" 18 #include "base/timer/timer.h"
19 #include "third_party/cros_system_api/dbus/service_constants.h" 19 #include "third_party/cros_system_api/dbus/service_constants.h"
20 #include "ui/display/display_export.h" 20 #include "ui/display/display_export.h"
21 #include "ui/display/types/display_constants.h" 21 #include "ui/display/types/display_constants.h"
22 #include "ui/display/types/display_mode.h"
22 #include "ui/display/types/native_display_observer.h" 23 #include "ui/display/types/native_display_observer.h"
23 #include "ui/gfx/geometry/size.h" 24 #include "ui/gfx/geometry/size.h"
24
25 namespace gfx { 25 namespace gfx {
26 class Point; 26 class Point;
27 class Size; 27 class Size;
28 } 28 }
29 29
30 namespace ui { 30 namespace ui {
31 struct DisplayConfigureRequest; 31 struct DisplayConfigureRequest;
32 class DisplayMode;
33 class DisplaySnapshot; 32 class DisplaySnapshot;
34 class NativeDisplayDelegate; 33 class NativeDisplayDelegate;
35 class UpdateDisplayConfigurationTask; 34 class UpdateDisplayConfigurationTask;
36 35
37 // This class interacts directly with the system display configurator. 36 // This class interacts directly with the system display configurator.
38 class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver { 37 class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver {
39 public: 38 public:
40 typedef uint64_t ContentProtectionClientId; 39 typedef uint64_t ContentProtectionClientId;
41 static const ContentProtectionClientId kInvalidClientId = 0; 40 static const ContentProtectionClientId kInvalidClientId = 0;
42 41
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 277
279 // Checks the available color profiles for |display_id| and fills the result 278 // Checks the available color profiles for |display_id| and fills the result
280 // into |profiles|. 279 // into |profiles|.
281 std::vector<ui::ColorCalibrationProfile> GetAvailableColorCalibrationProfiles( 280 std::vector<ui::ColorCalibrationProfile> GetAvailableColorCalibrationProfiles(
282 int64_t display_id); 281 int64_t display_id);
283 282
284 // Updates the color calibration to |new_profile|. 283 // Updates the color calibration to |new_profile|.
285 bool SetColorCalibrationProfile(int64_t display_id, 284 bool SetColorCalibrationProfile(int64_t display_id,
286 ui::ColorCalibrationProfile new_profile); 285 ui::ColorCalibrationProfile new_profile);
287 286
287 // Enable/disable virtual output
achuithb 2015/02/11 23:41:44 period
288 void EnableVirtualDisplay(scoped_ptr<DisplayMode> display_mode);
289 void DisableVirtualDisplay();
290 bool virtual_display_enabled() { return virtual_display_mode_.get(); }
achuithb 2015/02/11 23:41:44 this should be a const fn and it should be camelca
291
292 // Find the virtual display id, returns -1 if none
achuithb 2015/02/11 23:41:44 period
293 int64 GetVirtualDisplayId();
294
288 private: 295 private:
289 class DisplayLayoutManagerImpl; 296 class DisplayLayoutManagerImpl;
290 297
291 // Mapping a display_id to a protection request bitmask. 298 // Mapping a display_id to a protection request bitmask.
292 typedef std::map<int64_t, uint32_t> ContentProtections; 299 typedef std::map<int64_t, uint32_t> ContentProtections;
293 // Mapping a client to its protection request. 300 // Mapping a client to its protection request.
294 typedef std::map<ContentProtectionClientId, ContentProtections> 301 typedef std::map<ContentProtectionClientId, ContentProtections>
295 ProtectionRequests; 302 ProtectionRequests;
296 303
297 // Performs platform specific delegate initialization. 304 // Performs platform specific delegate initialization.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 417
411 // Display protection requests of each client. 418 // Display protection requests of each client.
412 ProtectionRequests client_protection_requests_; 419 ProtectionRequests client_protection_requests_;
413 420
414 // Display controlled by an external entity. 421 // Display controlled by an external entity.
415 bool display_externally_controlled_; 422 bool display_externally_controlled_;
416 423
417 // Whether the displays are currently suspended. 424 // Whether the displays are currently suspended.
418 bool displays_suspended_; 425 bool displays_suspended_;
419 426
427 // Virtual output control
achuithb 2015/02/11 23:41:44 period
428 scoped_ptr<DisplayMode> virtual_display_mode_;
429
420 scoped_ptr<DisplayLayoutManager> layout_manager_; 430 scoped_ptr<DisplayLayoutManager> layout_manager_;
421 431
422 scoped_ptr<UpdateDisplayConfigurationTask> configuration_task_; 432 scoped_ptr<UpdateDisplayConfigurationTask> configuration_task_;
423 433
424 // This must be the last variable. 434 // This must be the last variable.
425 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; 435 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_;
426 436
427 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); 437 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator);
428 }; 438 };
429 439
430 } // namespace ui 440 } // namespace ui
431 441
432 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ 442 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698