| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/renderer_host/render_widget_resize_helper_mac.h" | |
| 6 | |
| 7 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | |
| 9 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" | |
| 10 | |
| 11 namespace content { | |
| 12 namespace { | |
| 13 | |
| 14 void HandleGpuIPC(int gpu_host_id, const IPC::Message& message) { | |
| 15 GpuProcessHostUIShim* host = GpuProcessHostUIShim::FromID(gpu_host_id); | |
| 16 if (host) | |
| 17 host->OnMessageReceived(message); | |
| 18 } | |
| 19 | |
| 20 void HandleRendererIPC(int render_process_id, const IPC::Message& message) { | |
| 21 RenderProcessHost* host = RenderProcessHost::FromID(render_process_id); | |
| 22 if (host) | |
| 23 host->OnMessageReceived(message); | |
| 24 } | |
| 25 | |
| 26 } // namespace | |
| 27 | |
| 28 //////////////////////////////////////////////////////////////////////////////// | |
| 29 // RenderWidgetResizeHelper | |
| 30 | |
| 31 // static | |
| 32 void RenderWidgetResizeHelper::PostRendererProcessMsg(int render_process_id, | |
| 33 const IPC::Message& msg) { | |
| 34 ui::WindowResizeHelperMac::Get()->task_runner()->PostDelayedTask( | |
| 35 FROM_HERE, base::Bind(HandleRendererIPC, render_process_id, msg), | |
| 36 base::TimeDelta()); | |
| 37 } | |
| 38 | |
| 39 // static | |
| 40 void RenderWidgetResizeHelper::PostGpuProcessMsg(int gpu_host_id, | |
| 41 const IPC::Message& msg) { | |
| 42 ui::WindowResizeHelperMac::Get()->task_runner()->PostDelayedTask( | |
| 43 FROM_HERE, base::Bind(HandleGpuIPC, gpu_host_id, msg), base::TimeDelta()); | |
| 44 } | |
| 45 | |
| 46 } // namespace content | |
| OLD | NEW |