| 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 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2320 return; | 2320 return; |
| 2321 host->Send( | 2321 host->Send( |
| 2322 new ViewMsg_ReclaimCompositorResources(route_id, output_surface_id, ack)); | 2322 new ViewMsg_ReclaimCompositorResources(route_id, output_surface_id, ack)); |
| 2323 } | 2323 } |
| 2324 | 2324 |
| 2325 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() { | 2325 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() { |
| 2326 if (!is_threaded_compositing_enabled_) | 2326 if (!is_threaded_compositing_enabled_) |
| 2327 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); | 2327 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); |
| 2328 } | 2328 } |
| 2329 | 2329 |
| 2330 #if defined(USE_AURA) | |
| 2331 | |
| 2332 void RenderWidgetHostImpl::ParentChanged(gfx::NativeViewId new_parent) { | |
| 2333 #if defined(OS_WIN) | |
| 2334 HWND hwnd = reinterpret_cast<HWND>(new_parent); | |
| 2335 if (!hwnd) | |
| 2336 hwnd = GetDesktopWindow(); | |
| 2337 // On Windows GetParentForWindowlessPlugin returns the dummy window used as | |
| 2338 // the parent for windowless NPAPI plugins. Reparenting this window to the | |
| 2339 // new parent should be good enough. | |
| 2340 if (view_ && view_->GetParentForWindowlessPlugin()) | |
| 2341 SetParent(reinterpret_cast<HWND>(view_->GetParentForWindowlessPlugin()), | |
| 2342 reinterpret_cast<HWND>(new_parent)); | |
| 2343 #endif | |
| 2344 } | |
| 2345 | |
| 2346 #endif | |
| 2347 | |
| 2348 void RenderWidgetHostImpl::DelayedAutoResized() { | 2330 void RenderWidgetHostImpl::DelayedAutoResized() { |
| 2349 gfx::Size new_size = new_auto_size_; | 2331 gfx::Size new_size = new_auto_size_; |
| 2350 // Clear the new_auto_size_ since the empty value is used as a flag to | 2332 // Clear the new_auto_size_ since the empty value is used as a flag to |
| 2351 // indicate that no callback is in progress (i.e. without this line | 2333 // indicate that no callback is in progress (i.e. without this line |
| 2352 // DelayedAutoResized will not get called again). | 2334 // DelayedAutoResized will not get called again). |
| 2353 new_auto_size_.SetSize(0, 0); | 2335 new_auto_size_.SetSize(0, 0); |
| 2354 if (!should_auto_resize_) | 2336 if (!should_auto_resize_) |
| 2355 return; | 2337 return; |
| 2356 | 2338 |
| 2357 OnRenderAutoResized(new_size); | 2339 OnRenderAutoResized(new_size); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2546 } | 2528 } |
| 2547 } | 2529 } |
| 2548 | 2530 |
| 2549 // Add newly generated components into the latency info | 2531 // Add newly generated components into the latency info |
| 2550 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { | 2532 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { |
| 2551 latency_info->latency_components[lc->first] = lc->second; | 2533 latency_info->latency_components[lc->first] = lc->second; |
| 2552 } | 2534 } |
| 2553 } | 2535 } |
| 2554 | 2536 |
| 2555 } // namespace content | 2537 } // namespace content |
| OLD | NEW |