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 "content/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1821 | 1821 |
1822 // This may happen as a result of a race condition when the plugin is going | 1822 // This may happen as a result of a race condition when the plugin is going |
1823 // away. | 1823 // away. |
1824 wchar_t window_title[MAX_PATH + 1] = {0}; | 1824 wchar_t window_title[MAX_PATH + 1] = {0}; |
1825 if (!IsWindow(hwnd) || | 1825 if (!IsWindow(hwnd) || |
1826 !GetWindowText(hwnd, window_title, arraysize(window_title)) || | 1826 !GetWindowText(hwnd, window_title, arraysize(window_title)) || |
1827 lstrcmpiW(window_title, kDummyActivationWindowName) != 0) { | 1827 lstrcmpiW(window_title, kDummyActivationWindowName) != 0) { |
1828 return; | 1828 return; |
1829 } | 1829 } |
1830 | 1830 |
| 1831 #if defined(USE_AURA) |
1831 SetParent(hwnd, | 1832 SetParent(hwnd, |
1832 reinterpret_cast<HWND>(view_->GetParentForWindowlessPlugin())); | 1833 reinterpret_cast<HWND>(view_->GetParentForWindowlessPlugin())); |
| 1834 #else |
| 1835 SetParent(hwnd, reinterpret_cast<HWND>(GetNativeViewId())); |
| 1836 #endif |
1833 dummy_windows_for_activation_.push_back(hwnd); | 1837 dummy_windows_for_activation_.push_back(hwnd); |
1834 } | 1838 } |
1835 | 1839 |
1836 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowDestroyed( | 1840 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowDestroyed( |
1837 gfx::NativeViewId dummy_activation_window) { | 1841 gfx::NativeViewId dummy_activation_window) { |
1838 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); | 1842 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); |
1839 std::list<HWND>::iterator i = dummy_windows_for_activation_.begin(); | 1843 std::list<HWND>::iterator i = dummy_windows_for_activation_.begin(); |
1840 for (; i != dummy_windows_for_activation_.end(); ++i) { | 1844 for (; i != dummy_windows_for_activation_.end(); ++i) { |
1841 if ((*i) == hwnd) { | 1845 if ((*i) == hwnd) { |
1842 dummy_windows_for_activation_.erase(i); | 1846 dummy_windows_for_activation_.erase(i); |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2464 continue; | 2468 continue; |
2465 } | 2469 } |
2466 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); | 2470 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); |
2467 if (rwhi_set.insert(rwhi).second) | 2471 if (rwhi_set.insert(rwhi).second) |
2468 rwhi->FrameSwapped(latency_info); | 2472 rwhi->FrameSwapped(latency_info); |
2469 } | 2473 } |
2470 } | 2474 } |
2471 } | 2475 } |
2472 | 2476 |
2473 } // namespace content | 2477 } // namespace content |
OLD | NEW |