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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 InterlockedExchange(&request_sent_, 0); | 73 InterlockedExchange(&request_sent_, 0); |
74 content::RenderWidgetHost* rwh = | 74 content::RenderWidgetHost* rwh = |
75 content::RenderWidgetHost::FromID(process_id_, render_id_); | 75 content::RenderWidgetHost::FromID(process_id_, render_id_); |
76 if (!rwh) | 76 if (!rwh) |
77 return; | 77 return; |
78 content::RenderWidgetHostView* view = rwh->GetView(); | 78 content::RenderWidgetHostView* view = rwh->GetView(); |
79 if (!view) | 79 if (!view) |
80 return; | 80 return; |
81 gfx::NativeView native_view = view->GetNativeView(); | 81 gfx::NativeView native_view = view->GetNativeView(); |
82 #if defined(USE_AURA) | 82 #if defined(USE_AURA) |
83 aura::RootWindow* root = native_view->GetRootWindow(); | 83 aura::WindowEventDispatcher* dispatcher = native_view->GetDispatcher(); |
84 if (!root) | 84 if (!dispatcher) |
85 return; | 85 return; |
86 HWND window = root->GetAcceleratedWidget(); | 86 HWND window = dispatcher->GetAcceleratedWidget(); |
87 #else | 87 #else |
88 HWND window = native_view; | 88 HWND window = native_view; |
89 #endif | 89 #endif |
90 HMONITOR monitor = ::MonitorFromWindow(window, MONITOR_DEFAULTTONULL); | 90 HMONITOR monitor = ::MonitorFromWindow(window, MONITOR_DEFAULTTONULL); |
91 InterlockedExchangePointer(reinterpret_cast<void* volatile *>(&monitor_), | 91 InterlockedExchangePointer(reinterpret_cast<void* volatile *>(&monitor_), |
92 monitor); | 92 monitor); |
93 } | 93 } |
94 | 94 |
95 const int process_id_; | 95 const int process_id_; |
96 const int render_id_; | 96 const int render_id_; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 if (id.empty() && result == PP_OK) { | 176 if (id.empty() && result == PP_OK) { |
177 NOTREACHED(); | 177 NOTREACHED(); |
178 result = PP_ERROR_FAILED; | 178 result = PP_ERROR_FAILED; |
179 } | 179 } |
180 reply_context.params.set_result(result); | 180 reply_context.params.set_result(result); |
181 host()->SendReply(reply_context, | 181 host()->SendReply(reply_context, |
182 PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id)); | 182 PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id)); |
183 } | 183 } |
184 | 184 |
185 } // namespace chrome | 185 } // namespace chrome |
OLD | NEW |