Chromium Code Reviews| OLD | NEW |
|---|---|
| 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> |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 class UpdateDisplayConfigurationTask; | 35 class UpdateDisplayConfigurationTask; |
| 36 | 36 |
| 37 // This class interacts directly with the system display configurator. | 37 // This class interacts directly with the system display configurator. |
| 38 class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver { | 38 class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver { |
| 39 public: | 39 public: |
| 40 typedef uint64_t ContentProtectionClientId; | 40 typedef uint64_t ContentProtectionClientId; |
| 41 static const ContentProtectionClientId kInvalidClientId = 0; | 41 static const ContentProtectionClientId kInvalidClientId = 0; |
| 42 | 42 |
| 43 typedef base::Callback<void(bool)> ConfigurationCallback; | 43 typedef base::Callback<void(bool)> ConfigurationCallback; |
| 44 | 44 |
| 45 typedef base::Callback<void(bool /* success */)> EnableProtectionCallback; | |
| 46 | |
| 47 // |link_mask| is the type of connected display links, which is a bitmask of | |
| 48 // DisplayConnectionType values. |protection_mask| is the desired protection | |
| 49 // methods, which is a bitmask of the ContentProtectionMethod values. | |
| 50 typedef base::Callback<void(bool /* success */, | |
| 51 uint32_t /* link_mask */, | |
| 52 uint32_t /* protection_mask */)> | |
|
oshima
2015/04/02 16:00:51
It may be better to define struct instead of using
dnicoara
2015/04/14 20:15:43
Done.
| |
| 53 QueryProtectionCallback; | |
| 54 | |
| 45 typedef std::vector<DisplaySnapshot*> DisplayStateList; | 55 typedef std::vector<DisplaySnapshot*> DisplayStateList; |
| 46 | 56 |
| 47 class Observer { | 57 class Observer { |
| 48 public: | 58 public: |
| 49 virtual ~Observer() {} | 59 virtual ~Observer() {} |
| 50 | 60 |
| 51 // Called after the display mode has been changed. |display| contains the | 61 // Called after the display mode has been changed. |display| contains the |
| 52 // just-applied configuration. Note that the X server is no longer grabbed | 62 // just-applied configuration. Note that the X server is no longer grabbed |
| 53 // when this method is called, so the actual configuration could've changed | 63 // when this method is called, so the actual configuration could've changed |
| 54 // already. | 64 // already. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 // suspended. | 243 // suspended. |
| 234 void ResumeDisplays(); | 244 void ResumeDisplays(); |
| 235 | 245 |
| 236 // Registers a client for display protection and requests a client id. Returns | 246 // Registers a client for display protection and requests a client id. Returns |
| 237 // 0 if requesting failed. | 247 // 0 if requesting failed. |
| 238 ContentProtectionClientId RegisterContentProtectionClient(); | 248 ContentProtectionClientId RegisterContentProtectionClient(); |
| 239 | 249 |
| 240 // Unregisters the client. | 250 // Unregisters the client. |
| 241 void UnregisterContentProtectionClient(ContentProtectionClientId client_id); | 251 void UnregisterContentProtectionClient(ContentProtectionClientId client_id); |
| 242 | 252 |
| 243 // Queries link status and protection status. | 253 // Queries link status and protection status. |callback| is used to respond |
| 244 // |link_mask| is the type of connected display links, which is a bitmask of | 254 // to the query. |
| 245 // DisplayConnectionType values. |protection_mask| is the desired protection | 255 void QueryContentProtectionStatus(ContentProtectionClientId client_id, |
| 246 // methods, which is a bitmask of the ContentProtectionMethod values. | |
| 247 // Returns true on success. | |
| 248 bool QueryContentProtectionStatus(ContentProtectionClientId client_id, | |
| 249 int64_t display_id, | 256 int64_t display_id, |
| 250 uint32_t* link_mask, | 257 const QueryProtectionCallback& callback); |
| 251 uint32_t* protection_mask); | |
| 252 | 258 |
| 253 // Requests the desired protection methods. | 259 // Requests the desired protection methods. |
| 254 // |protection_mask| is the desired protection methods, which is a bitmask | 260 // |protection_mask| is the desired protection methods, which is a bitmask |
| 255 // of the ContentProtectionMethod values. | 261 // of the ContentProtectionMethod values. |
| 256 // Returns true when the protection request has been made. | 262 // Returns true when the protection request has been made. |
| 257 bool EnableContentProtection(ContentProtectionClientId client_id, | 263 void EnableContentProtection(ContentProtectionClientId client_id, |
| 258 int64_t display_id, | 264 int64_t display_id, |
| 259 uint32_t desired_protection_mask); | 265 uint32_t protection_mask, |
| 266 const EnableProtectionCallback& callback); | |
| 260 | 267 |
| 261 // Checks the available color profiles for |display_id| and fills the result | 268 // Checks the available color profiles for |display_id| and fills the result |
| 262 // into |profiles|. | 269 // into |profiles|. |
| 263 std::vector<ui::ColorCalibrationProfile> GetAvailableColorCalibrationProfiles( | 270 std::vector<ui::ColorCalibrationProfile> GetAvailableColorCalibrationProfiles( |
| 264 int64_t display_id); | 271 int64_t display_id); |
| 265 | 272 |
| 266 // Updates the color calibration to |new_profile|. | 273 // Updates the color calibration to |new_profile|. |
| 267 bool SetColorCalibrationProfile(int64_t display_id, | 274 bool SetColorCalibrationProfile(int64_t display_id, |
| 268 ui::ColorCalibrationProfile new_profile); | 275 ui::ColorCalibrationProfile new_profile); |
| 269 | 276 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 402 | 409 |
| 403 // This must be the last variable. | 410 // This must be the last variable. |
| 404 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; | 411 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; |
| 405 | 412 |
| 406 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); | 413 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); |
| 407 }; | 414 }; |
| 408 | 415 |
| 409 } // namespace ui | 416 } // namespace ui |
| 410 | 417 |
| 411 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 418 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
| OLD | NEW |