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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 ~MonitorFinder() { } | 70 ~MonitorFinder() { } |
71 | 71 |
72 void FetchMonitorFromWidget() { | 72 void FetchMonitorFromWidget() { |
73 InterlockedExchange(&request_sent_, 0); | 73 InterlockedExchange(&request_sent_, 0); |
74 content::RenderFrameHost* rfh = | 74 content::RenderFrameHost* rfh = |
75 content::RenderFrameHost::FromID(process_id_, render_frame_id_); | 75 content::RenderFrameHost::FromID(process_id_, render_frame_id_); |
76 if (!rfh) | 76 if (!rfh) |
77 return; | 77 return; |
78 gfx::NativeView native_view = rfh->GetNativeView(); | 78 gfx::NativeView native_view = rfh->GetNativeView(); |
79 #if defined(USE_AURA) | 79 #if defined(USE_AURA) |
80 aura::WindowEventDispatcher* dispatcher = native_view->GetDispatcher(); | 80 aura::WindowTreeHost* host = native_view->GetHost(); |
81 if (!dispatcher) | 81 if (!host) |
82 return; | 82 return; |
83 HWND window = dispatcher->host()->GetAcceleratedWidget(); | 83 HWND window = host->GetAcceleratedWidget(); |
84 #else | 84 #else |
85 HWND window = native_view; | 85 HWND window = native_view; |
86 #endif | 86 #endif |
87 HMONITOR monitor = ::MonitorFromWindow(window, MONITOR_DEFAULTTONULL); | 87 HMONITOR monitor = ::MonitorFromWindow(window, MONITOR_DEFAULTTONULL); |
88 InterlockedExchangePointer(reinterpret_cast<void* volatile *>(&monitor_), | 88 InterlockedExchangePointer(reinterpret_cast<void* volatile *>(&monitor_), |
89 monitor); | 89 monitor); |
90 } | 90 } |
91 | 91 |
92 const int process_id_; | 92 const int process_id_; |
93 const int render_frame_id_; | 93 const int render_frame_id_; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 if (id.empty() && result == PP_OK) { | 188 if (id.empty() && result == PP_OK) { |
189 NOTREACHED(); | 189 NOTREACHED(); |
190 result = PP_ERROR_FAILED; | 190 result = PP_ERROR_FAILED; |
191 } | 191 } |
192 reply_context.params.set_result(result); | 192 reply_context.params.set_result(result); |
193 host()->SendReply(reply_context, | 193 host()->SendReply(reply_context, |
194 PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id)); | 194 PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id)); |
195 } | 195 } |
196 | 196 |
197 } // namespace chrome | 197 } // namespace chrome |
OLD | NEW |