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 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2325 return; | 2325 return; |
2326 host->Send( | 2326 host->Send( |
2327 new ViewMsg_ReclaimCompositorResources(route_id, output_surface_id, ack)); | 2327 new ViewMsg_ReclaimCompositorResources(route_id, output_surface_id, ack)); |
2328 } | 2328 } |
2329 | 2329 |
2330 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() { | 2330 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() { |
2331 if (!is_threaded_compositing_enabled_) | 2331 if (!is_threaded_compositing_enabled_) |
2332 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); | 2332 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); |
2333 } | 2333 } |
2334 | 2334 |
2335 #if defined(USE_AURA) | |
2336 | |
2337 void RenderWidgetHostImpl::ParentChanged(gfx::NativeViewId new_parent) { | |
2338 #if defined(OS_WIN) | |
2339 HWND hwnd = reinterpret_cast<HWND>(new_parent); | |
2340 if (!hwnd) | |
2341 hwnd = GetDesktopWindow(); | |
2342 // On Windows GetParentForWindowlessPlugin returns the dummy window used as | |
2343 // the parent for windowless NPAPI plugins. Reparenting this window to the | |
2344 // new parent should be good enough. | |
2345 if (view_ && view_->GetParentForWindowlessPlugin()) | |
2346 SetParent(reinterpret_cast<HWND>(view_->GetParentForWindowlessPlugin()), | |
2347 reinterpret_cast<HWND>(new_parent)); | |
2348 #endif | |
2349 } | |
2350 | |
2351 #endif | |
2352 | |
2353 void RenderWidgetHostImpl::DelayedAutoResized() { | 2335 void RenderWidgetHostImpl::DelayedAutoResized() { |
2354 gfx::Size new_size = new_auto_size_; | 2336 gfx::Size new_size = new_auto_size_; |
2355 // Clear the new_auto_size_ since the empty value is used as a flag to | 2337 // Clear the new_auto_size_ since the empty value is used as a flag to |
2356 // indicate that no callback is in progress (i.e. without this line | 2338 // indicate that no callback is in progress (i.e. without this line |
2357 // DelayedAutoResized will not get called again). | 2339 // DelayedAutoResized will not get called again). |
2358 new_auto_size_.SetSize(0, 0); | 2340 new_auto_size_.SetSize(0, 0); |
2359 if (!should_auto_resize_) | 2341 if (!should_auto_resize_) |
2360 return; | 2342 return; |
2361 | 2343 |
2362 OnRenderAutoResized(new_size); | 2344 OnRenderAutoResized(new_size); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2572 } | 2554 } |
2573 } | 2555 } |
2574 | 2556 |
2575 // Add newly generated components into the latency info | 2557 // Add newly generated components into the latency info |
2576 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { | 2558 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { |
2577 latency_info->latency_components[lc->first] = lc->second; | 2559 latency_info->latency_components[lc->first] = lc->second; |
2578 } | 2560 } |
2579 } | 2561 } |
2580 | 2562 |
2581 } // namespace content | 2563 } // namespace content |
OLD | NEW |