Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 } | 65 } |
| 66 | 66 |
| 67 void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) { | 67 void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) { |
| 68 // Reparent only to our process. | 68 // Reparent only to our process. |
| 69 DWORD process_id = 0; | 69 DWORD process_id = 0; |
| 70 ::GetWindowThreadProcessId(parent, &process_id); | 70 ::GetWindowThreadProcessId(parent, &process_id); |
| 71 if (process_id != ::GetCurrentProcessId()) | 71 if (process_id != ::GetCurrentProcessId()) |
| 72 return; | 72 return; |
| 73 | 73 |
| 74 if (webkit::npapi::WebPluginDelegateImpl::IsDummyActivationWindow(window)) { | 74 if (webkit::npapi::WebPluginDelegateImpl::IsDummyActivationWindow(window)) { |
| 75 ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD); | 75 BrowserThread::PostTask( |
| 76 BrowserThread::UI, FROM_HERE, | |
| 77 NewRunnableFunction(::SetWindowLongPtr, window, GWL_STYLE, WS_CHILD)); | |
| 76 } else { | 78 } else { |
| 77 ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | | 79 BrowserThread::PostTask( |
| 78 WS_CLIPSIBLINGS); | 80 BrowserThread::UI, FROM_HERE, |
| 81 NewRunnableFunction(::SetWindowLongPtr, window, GWL_STYLE, | |
| 82 WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS)); | |
| 79 } | 83 } |
| 80 ::SetParent(window, parent); | 84 BrowserThread::PostTask( |
| 85 BrowserThread::UI, FROM_HERE, | |
| 86 NewRunnableFunction(::SetParent, window, parent)); | |
|
cpu_(ooo_6.6-7.5)
2011/06/08 18:04:31
Is not easier to just make a single function that
ananta
2011/06/08 18:10:47
Done.
| |
| 81 } | 87 } |
| 82 #endif // defined(OS_WIN) | 88 #endif // defined(OS_WIN) |
| 83 | 89 |
| 84 #if defined(TOOLKIT_USES_GTK) | 90 #if defined(TOOLKIT_USES_GTK) |
| 85 void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id, | 91 void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id, |
| 86 gfx::PluginWindowHandle* output) { | 92 gfx::PluginWindowHandle* output) { |
| 87 *output = 0; | 93 *output = 0; |
| 88 GtkNativeViewManager::GetInstance()->GetXIDForId(output, id); | 94 GtkNativeViewManager::GetInstance()->GetXIDForId(output, id); |
| 89 } | 95 } |
| 90 #endif // defined(TOOLKIT_USES_GTK) | 96 #endif // defined(TOOLKIT_USES_GTK) |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 } | 351 } |
| 346 } | 352 } |
| 347 | 353 |
| 348 void PluginProcessHost::OnChannelCreated( | 354 void PluginProcessHost::OnChannelCreated( |
| 349 const IPC::ChannelHandle& channel_handle) { | 355 const IPC::ChannelHandle& channel_handle) { |
| 350 Client* client = sent_requests_.front(); | 356 Client* client = sent_requests_.front(); |
| 351 | 357 |
| 352 client->OnChannelOpened(channel_handle); | 358 client->OnChannelOpened(channel_handle); |
| 353 sent_requests_.pop(); | 359 sent_requests_.pop(); |
| 354 } | 360 } |
| OLD | NEW |