| 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 #include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h" | 5 #include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <Windows.h> | 8 #include <Windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 if (monitor_id) { | 163 if (monitor_id) { |
| 164 context->reply_msg = PpapiPluginMsg_FlashDRM_GetHmonitorReply(monitor_id); | 164 context->reply_msg = PpapiPluginMsg_FlashDRM_GetHmonitorReply(monitor_id); |
| 165 return PP_OK; | 165 return PP_OK; |
| 166 } | 166 } |
| 167 return PP_ERROR_FAILED; | 167 return PP_ERROR_FAILED; |
| 168 } | 168 } |
| 169 | 169 |
| 170 int32_t PepperFlashDRMHost::OnHostMsgMonitorIsExternal( | 170 int32_t PepperFlashDRMHost::OnHostMsgMonitorIsExternal( |
| 171 ppapi::host::HostMessageContext* context) { | 171 ppapi::host::HostMessageContext* context) { |
| 172 int64_t monitor_id = monitor_finder_->GetMonitor(); | 172 int64_t monitor_id = monitor_finder_->GetMonitor(); |
| 173 if (monitor_id) { | 173 if (!monitor_id) |
| 174 // TODO(bbudge) get information about whether monitor is external. | 174 return PP_ERROR_FAILED; |
| 175 context->reply_msg = | 175 |
| 176 PpapiPluginMsg_FlashDRM_MonitorIsExternalReply(PP_FALSE); | 176 PP_Bool is_external = PP_FALSE; |
| 177 return PP_OK; | 177 #if defined(OS_MACOSX) |
| 178 } | 178 if (!MonitorFinder::IsMonitorBuiltIn(monitor_id)) |
| 179 return PP_ERROR_FAILED; | 179 is_external = PP_TRUE; |
| 180 #endif |
| 181 context->reply_msg = |
| 182 PpapiPluginMsg_FlashDRM_MonitorIsExternalReply(is_external); |
| 183 return PP_OK; |
| 180 } | 184 } |
| 181 | 185 |
| 182 void PepperFlashDRMHost::GotDeviceID( | 186 void PepperFlashDRMHost::GotDeviceID( |
| 183 ppapi::host::ReplyMessageContext reply_context, | 187 ppapi::host::ReplyMessageContext reply_context, |
| 184 const std::string& id, | 188 const std::string& id, |
| 185 int32_t result) { | 189 int32_t result) { |
| 186 if (id.empty() && result == PP_OK) { | 190 if (id.empty() && result == PP_OK) { |
| 187 NOTREACHED(); | 191 NOTREACHED(); |
| 188 result = PP_ERROR_FAILED; | 192 result = PP_ERROR_FAILED; |
| 189 } | 193 } |
| 190 reply_context.params.set_result(result); | 194 reply_context.params.set_result(result); |
| 191 host()->SendReply(reply_context, | 195 host()->SendReply(reply_context, |
| 192 PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id)); | 196 PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id)); |
| 193 } | 197 } |
| 194 | 198 |
| 195 } // namespace chrome | 199 } // namespace chrome |
| OLD | NEW |