Chromium Code Reviews| 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 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_H__ | 5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_H__ |
| 6 #define CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_H__ | 6 #define CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "content/common/browser_plugin_info.h" | |
|
Fady Samuel
2012/07/06 15:14:44
Given you're applying changes to the new design, c
scshunt
2012/07/06 16:39:03
Yeah. It was leftover. I did no cleaning on this p
| |
| 12 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
| 14 #include "content/public/browser/web_contents_delegate.h" | 15 #include "content/public/browser/web_contents_delegate.h" |
| 15 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
| 16 #include "ppapi/c/pp_instance.h" | 17 #include "ppapi/c/pp_instance.h" |
| 17 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
| 18 | 19 |
| 19 class WebContentsImpl; | 20 class WebContentsImpl; |
| 20 | 21 |
| 21 namespace IPC { | 22 namespace IPC { |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 44 | 45 |
| 45 void ConnectEmbedderToChannel(RenderViewHost* render_view_host, | 46 void ConnectEmbedderToChannel(RenderViewHost* render_view_host, |
| 46 const IPC::ChannelHandle& handle); | 47 const IPC::ChannelHandle& handle); |
| 47 | 48 |
| 48 // This is called on the first navigation of the browser plugin. It creates | 49 // This is called on the first navigation of the browser plugin. It creates |
| 49 // a new WebContentsImpl for the guest, associates it with its embedder, sets | 50 // a new WebContentsImpl for the guest, associates it with its embedder, sets |
| 50 // its size and navigates it to the src URL. | 51 // its size and navigates it to the src URL. |
| 51 void NavigateGuestFromEmbedder(RenderViewHost* render_view_host, | 52 void NavigateGuestFromEmbedder(RenderViewHost* render_view_host, |
| 52 int container_instance_id, | 53 int container_instance_id, |
| 53 long long frame_id, | 54 long long frame_id, |
| 54 const std::string& src); | 55 const std::string& src, |
| 56 const BrowserPluginHostMsg_Surface_Params& para ms); | |
| 55 | 57 |
| 56 RenderProcessHost* embedder_render_process_host() const { | 58 RenderProcessHost* embedder_render_process_host() const { |
| 57 return embedder_render_process_host_; | 59 return embedder_render_process_host_; |
| 58 } | 60 } |
| 59 int instance_id() const { return instance_id_; } | 61 int instance_id() const { return instance_id_; } |
| 60 | 62 |
| 63 void set_surface_params(const BrowserPluginHostMsg_Surface_Params& params) { | |
| 64 surface_params_ = params; | |
| 65 } | |
| 66 | |
| 67 void SendSurfaceNewToEmbedder(const BrowserPlugMsg_SurfaceNew_Params& params); | |
| 68 | |
| 61 private: | 69 private: |
| 62 typedef std::map<WebContentsImpl*, int64> GuestMap; | 70 typedef std::map<WebContentsImpl*, int64> GuestMap; |
| 63 typedef std::map<int, BrowserPluginHost*> ContainerInstanceMap; | 71 typedef std::map<int, BrowserPluginHost*> ContainerInstanceMap; |
| 64 | 72 |
| 65 // Get a guest BrowserPluginHost by its container ID specified | 73 // Get a guest BrowserPluginHost by its container ID specified |
| 66 // in BrowserPlugin. | 74 // in BrowserPlugin. |
| 67 BrowserPluginHost* GetGuestByContainerID(int container_id); | 75 BrowserPluginHost* GetGuestByContainerID(int container_id); |
| 68 | 76 |
| 69 // Associate a guest with its container instance ID. | 77 // Associate a guest with its container instance ID. |
| 70 void RegisterContainerInstance( | 78 void RegisterContainerInstance( |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 // A scoped container for notification registries. | 126 // A scoped container for notification registries. |
| 119 NotificationRegistrar registrar_; | 127 NotificationRegistrar registrar_; |
| 120 RenderProcessHost* embedder_render_process_host_; | 128 RenderProcessHost* embedder_render_process_host_; |
| 121 std::string embedder_channel_name_; | 129 std::string embedder_channel_name_; |
| 122 // An identifier that uniquely identifies a browser plugin container | 130 // An identifier that uniquely identifies a browser plugin container |
| 123 // within an embedder. | 131 // within an embedder. |
| 124 int instance_id_; | 132 int instance_id_; |
| 125 GuestMap guests_; | 133 GuestMap guests_; |
| 126 ContainerInstanceMap guests_by_container_id_; | 134 ContainerInstanceMap guests_by_container_id_; |
| 127 | 135 |
| 136 BrowserPluginHostMsg_Surface_Params surface_params_; | |
| 137 | |
| 128 DISALLOW_COPY_AND_ASSIGN(BrowserPluginHost); | 138 DISALLOW_COPY_AND_ASSIGN(BrowserPluginHost); |
| 129 }; | 139 }; |
| 130 | 140 |
| 131 } // namespace content | 141 } // namespace content |
| 132 | 142 |
| 133 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_H_ | 143 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_H_ |
| OLD | NEW |