Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ | 5 #ifndef CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ |
| 6 #define CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ | 6 #define CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <map> | |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 12 #include "chromeos/display/output_configurator.h" | 13 #include "chromeos/display/output_configurator.h" |
| 14 #include "ppapi/c/private/ppb_output_protection_private.h" | |
|
kcwu
2013/09/06 15:12:16
I included this for enums.
But presubmit error on
| |
| 13 | 15 |
| 14 typedef XID Window; | 16 typedef XID Window; |
| 15 | 17 |
| 16 struct _XDisplay; | 18 struct _XDisplay; |
| 17 typedef struct _XDisplay Display; | 19 typedef struct _XDisplay Display; |
| 18 struct _XRROutputInfo; | 20 struct _XRROutputInfo; |
| 19 typedef _XRROutputInfo XRROutputInfo; | 21 typedef _XRROutputInfo XRROutputInfo; |
| 20 struct _XRRScreenResources; | 22 struct _XRRScreenResources; |
| 21 typedef _XRRScreenResources XRRScreenResources; | 23 typedef _XRRScreenResources XRRScreenResources; |
| 22 | 24 |
| 25 namespace chrome { | |
| 26 class PepperOutputProtectionHost; | |
| 27 } // namespace chrome | |
| 28 | |
| 23 namespace chromeos { | 29 namespace chromeos { |
| 24 | 30 |
| 25 class RealOutputConfiguratorDelegate : public OutputConfigurator::Delegate { | 31 class RealOutputConfiguratorDelegate : public OutputConfigurator::Delegate { |
| 26 public: | 32 public: |
| 27 RealOutputConfiguratorDelegate(); | 33 RealOutputConfiguratorDelegate(); |
| 28 virtual ~RealOutputConfiguratorDelegate(); | 34 virtual ~RealOutputConfiguratorDelegate(); |
| 29 | 35 |
| 30 // OutputConfigurator::Delegate overrides: | 36 // OutputConfigurator::Delegate overrides: |
| 31 virtual void SetPanelFittingEnabled(bool enabled) OVERRIDE; | 37 virtual void SetPanelFittingEnabled(bool enabled) OVERRIDE; |
| 32 virtual void InitXRandRExtension(int* event_base) OVERRIDE; | 38 virtual void InitXRandRExtension(int* event_base) OVERRIDE; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 46 int x, | 52 int x, |
| 47 int y) OVERRIDE; | 53 int y) OVERRIDE; |
| 48 virtual void CreateFrameBuffer( | 54 virtual void CreateFrameBuffer( |
| 49 int width, | 55 int width, |
| 50 int height, | 56 int height, |
| 51 const std::vector<OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; | 57 const std::vector<OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; |
| 52 virtual void ConfigureCTM( | 58 virtual void ConfigureCTM( |
| 53 int touch_device_id, | 59 int touch_device_id, |
| 54 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE; | 60 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE; |
| 55 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE; | 61 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE; |
| 62 virtual bool QueryOutputProtectionStatus( | |
| 63 chrome::PepperOutputProtectionHost* client, | |
| 64 uint32_t* link_mask, | |
| 65 uint32_t* protection_mask) OVERRIDE; | |
| 66 virtual bool EnableOutputProtection( | |
| 67 chrome::PepperOutputProtectionHost* client, | |
| 68 uint32_t desired_method_mask) OVERRIDE; | |
| 56 | 69 |
| 57 private: | 70 private: |
| 71 typedef std::map<chrome::PepperOutputProtectionHost*, uint32_t> | |
| 72 ProtectionRequests; | |
| 73 | |
| 74 enum HDCPState { | |
| 75 HDCP_State_Undesired, | |
| 76 HDCP_State_Desired, | |
| 77 HDCP_State_Enabled | |
| 78 }; | |
| 79 | |
| 58 // Gets details corresponding to |mode|. Parameters may be NULL. Returns | 80 // Gets details corresponding to |mode|. Parameters may be NULL. Returns |
| 59 // true on success. | 81 // true on success. |
| 60 bool GetModeDetails(RRMode mode, int* width, int* height, bool* interlaced); | 82 bool GetModeDetails(RRMode mode, int* width, int* height, bool* interlaced); |
| 61 | 83 |
| 62 // Helper method for GetOutputs() that returns an OutputSnapshot struct based | 84 // Helper method for GetOutputs() that returns an OutputSnapshot struct based |
| 63 // on the passed-in information. Further initialization is required (e.g. | 85 // on the passed-in information. Further initialization is required (e.g. |
| 64 // |selected_mode|, |mirror_mode|, and |touch_device_id|). | 86 // |selected_mode|, |mirror_mode|, and |touch_device_id|). |
| 65 OutputConfigurator::OutputSnapshot InitOutputSnapshot( | 87 OutputConfigurator::OutputSnapshot InitOutputSnapshot( |
| 66 RROutput id, | 88 RROutput id, |
| 67 XRROutputInfo* info, | 89 XRROutputInfo* info, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 98 RRMode* external_mirror_mode); | 120 RRMode* external_mirror_mode); |
| 99 | 121 |
| 100 // Searches for touchscreens among input devices, | 122 // Searches for touchscreens among input devices, |
| 101 // and tries to match them up to screens in |outputs|. | 123 // and tries to match them up to screens in |outputs|. |
| 102 // |outputs| is an array of detected screens. | 124 // |outputs| is an array of detected screens. |
| 103 // If a touchscreen with same resolution as an output's native mode | 125 // If a touchscreen with same resolution as an output's native mode |
| 104 // is detected, its id will be stored in this output. | 126 // is detected, its id will be stored in this output. |
| 105 void GetTouchscreens( | 127 void GetTouchscreens( |
| 106 std::vector<OutputConfigurator::OutputSnapshot>* outputs); | 128 std::vector<OutputConfigurator::OutputSnapshot>* outputs); |
| 107 | 129 |
| 130 // Get HDCP state of output. | |
| 131 bool GetHDCPState(RROutput id, HDCPState* state); | |
| 132 // Set HDCP state of output. | |
| 133 bool SetHDCPState(RROutput id, HDCPState state); | |
| 134 // Get types of connected output links. | |
| 135 bool GetOutputLinkType( | |
| 136 std::vector<PP_OutputProtectionLinkType_Private>& link_type); | |
| 137 // Get the bit-mask of connected output links. | |
| 138 bool GetOutputLinkMask(uint32_t* link_mask); | |
| 139 // Get the bit-mask of enabled protection methods. | |
| 140 bool GetProtectionMethods(uint32_t* protection_mask); | |
| 141 // Get the bit-mask of all requested protection methods. | |
| 142 uint32_t GetCombinedProtectionRequest(); | |
| 143 | |
| 108 Display* display_; | 144 Display* display_; |
| 109 Window window_; | 145 Window window_; |
| 110 | 146 |
| 111 // Initialized when the server is grabbed and freed when it's ungrabbed. | 147 // Initialized when the server is grabbed and freed when it's ungrabbed. |
| 112 XRRScreenResources* screen_; | 148 XRRScreenResources* screen_; |
| 113 | 149 |
| 114 // Used to enable modes which rely on panel fitting. | 150 // Used to enable modes which rely on panel fitting. |
| 115 bool is_panel_fitting_enabled_; | 151 bool is_panel_fitting_enabled_; |
| 116 | 152 |
| 153 // Output protection requests of each client. | |
| 154 ProtectionRequests client_protection_request_; | |
| 155 | |
| 117 DISALLOW_COPY_AND_ASSIGN(RealOutputConfiguratorDelegate); | 156 DISALLOW_COPY_AND_ASSIGN(RealOutputConfiguratorDelegate); |
| 118 }; | 157 }; |
| 119 | 158 |
| 120 } // namespace chromeos | 159 } // namespace chromeos |
| 121 | 160 |
| 122 #endif // CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ | 161 #endif // CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ |
| OLD | NEW |