OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_GUEST_RENDER_VIEW_OBSERVER_H_ |
| 6 #define CONTENT_RENDERER_GUEST_RENDER_VIEW_OBSERVER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "content/public/renderer/render_view_observer.h" |
| 10 #include "content/renderer/guest_to_host_channel.h" |
| 11 |
| 12 namespace content { |
| 13 class RenderView; |
| 14 } |
| 15 |
| 16 class GuestRenderViewObserver: public content::RenderViewObserver { |
| 17 public: |
| 18 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 19 |
| 20 WebKit::WebGraphicsContext3D* GetWebGraphicsContext3D() OVERRIDE; |
| 21 |
| 22 int routing_id() { return content::RenderViewObserver::routing_id(); } |
| 23 |
| 24 private: |
| 25 GuestRenderViewObserver(content::RenderView* render_view); |
| 26 |
| 27 ~GuestRenderViewObserver() { } |
| 28 |
| 29 // This message arrives to indicate to the RenderView that it is |
| 30 // to begin initializing itself as a pepper plugin and establish |
| 31 // a channel with a host RenderView. |
| 32 void OnMsgCreateChannel(base::ProcessHandle host_process_handle, |
| 33 int renderer_id); |
| 34 |
| 35 // This message arrives after a guest-to-host channel has been established. |
| 36 // The host is now free to swap out the BrowserPluginPlaceholder with the |
| 37 // real browser plugin. |
| 38 void OnMsgGuestReady(int instance_id, |
| 39 base::ProcessHandle process_handle, |
| 40 const IPC::ChannelHandle& channel_handle); |
| 41 |
| 42 void GraphicsContextCreated(); |
| 43 |
| 44 GuestToHostChannel guest_to_host_channel_; |
| 45 |
| 46 friend class RenderViewImpl; |
| 47 friend class GuestToHostChannel; |
| 48 }; |
| 49 |
| 50 #endif // CONTENT_RENDERER_GUEST_RENDER_VIEW_OBSERVER_H_ |
OLD | NEW |