| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PLUGIN_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #include <queue> | 11 #include <queue> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "content/browser/browser_child_process_host.h" | 18 #include "content/browser/browser_child_process_host.h" |
| 19 #include "webkit/plugins/webplugininfo.h" | 19 #include "webkit/plugins/webplugininfo.h" |
| 20 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
| 21 | 21 |
| 22 namespace content { |
| 23 class ResourceContext; |
| 24 } |
| 25 |
| 22 namespace gfx { | 26 namespace gfx { |
| 23 class Rect; | 27 class Rect; |
| 24 } | 28 } |
| 25 | 29 |
| 26 namespace IPC { | 30 namespace IPC { |
| 27 struct ChannelHandle; | 31 struct ChannelHandle; |
| 28 } | 32 } |
| 29 | 33 |
| 30 class GURL; | 34 class GURL; |
| 31 | 35 |
| 32 // Represents the browser side of the browser <--> plugin communication | 36 // Represents the browser side of the browser <--> plugin communication |
| 33 // channel. Different plugins run in their own process, but multiple instances | 37 // channel. Different plugins run in their own process, but multiple instances |
| 34 // of the same plugin run in the same process. There will be one | 38 // of the same plugin run in the same process. There will be one |
| 35 // PluginProcessHost per plugin process, matched with a corresponding | 39 // PluginProcessHost per plugin process, matched with a corresponding |
| 36 // PluginProcess running in the plugin process. The browser is responsible for | 40 // PluginProcess running in the plugin process. The browser is responsible for |
| 37 // starting the plugin process when a plugin is created that doesn't already | 41 // starting the plugin process when a plugin is created that doesn't already |
| 38 // have a process. After that, most of the communication is directly between | 42 // have a process. After that, most of the communication is directly between |
| 39 // the renderer and plugin processes. | 43 // the renderer and plugin processes. |
| 40 class PluginProcessHost : public BrowserChildProcessHost { | 44 class PluginProcessHost : public BrowserChildProcessHost { |
| 41 public: | 45 public: |
| 42 class Client { | 46 class Client { |
| 43 public: | 47 public: |
| 44 // Returns a opaque unique identifier for the process requesting | 48 // Returns an opaque unique identifier for the process requesting |
| 45 // the channel. | 49 // the channel. |
| 46 virtual int ID() = 0; | 50 virtual int ID() = 0; |
| 51 // Returns the resource context for the renderer requesting the channel. |
| 52 virtual const content::ResourceContext& GetResourceContext() = 0; |
| 47 virtual bool OffTheRecord() = 0; | 53 virtual bool OffTheRecord() = 0; |
| 48 virtual void SetPluginInfo(const webkit::WebPluginInfo& info) = 0; | 54 virtual void SetPluginInfo(const webkit::WebPluginInfo& info) = 0; |
| 49 // The client should delete itself when one of these methods is called. | 55 // The client should delete itself when one of these methods is called. |
| 50 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) = 0; | 56 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) = 0; |
| 51 virtual void OnError() = 0; | 57 virtual void OnError() = 0; |
| 52 | 58 |
| 53 protected: | 59 protected: |
| 54 virtual ~Client() {} | 60 virtual ~Client() {} |
| 55 }; | 61 }; |
| 56 | 62 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // Tracks modal windows currently visible. | 151 // Tracks modal windows currently visible. |
| 146 std::set<uint32> plugin_modal_windows_set_; | 152 std::set<uint32> plugin_modal_windows_set_; |
| 147 // Tracks the current visibility of the cursor. | 153 // Tracks the current visibility of the cursor. |
| 148 bool plugin_cursor_visible_; | 154 bool plugin_cursor_visible_; |
| 149 #endif | 155 #endif |
| 150 | 156 |
| 151 DISALLOW_COPY_AND_ASSIGN(PluginProcessHost); | 157 DISALLOW_COPY_AND_ASSIGN(PluginProcessHost); |
| 152 }; | 158 }; |
| 153 | 159 |
| 154 #endif // CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ | 160 #endif // CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ |
| OLD | NEW |