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_COMMON_CONTENT_CLIENT_H_ | 5 #ifndef CONTENT_COMMON_CONTENT_CLIENT_H_ |
6 #define CONTENT_COMMON_CONTENT_CLIENT_H_ | 6 #define CONTENT_COMMON_CONTENT_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <vector> |
| 10 |
9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
10 | 12 |
11 class GURL; | 13 class GURL; |
12 struct GPUInfo; | 14 struct GPUInfo; |
| 15 struct PepperPluginInfo; |
13 | 16 |
14 namespace content { | 17 namespace content { |
15 | 18 |
16 class ContentBrowserClient; | 19 class ContentBrowserClient; |
17 class ContentClient; | 20 class ContentClient; |
18 class ContentPluginClient; | 21 class ContentPluginClient; |
19 class ContentRendererClient; | 22 class ContentRendererClient; |
20 | 23 |
21 // Setter and getter for the client. The client should be set early, before any | 24 // Setter and getter for the client. The client should be set early, before any |
22 // content code is called. | 25 // content code is called. |
23 void SetContentClient(ContentClient* client); | 26 void SetContentClient(ContentClient* client); |
24 ContentClient* GetContentClient(); | 27 ContentClient* GetContentClient(); |
25 | 28 |
26 // Interface that the embedder implements. | 29 // Interface that the embedder implements. |
27 class ContentClient { | 30 class ContentClient { |
28 public: | 31 public: |
29 ContentClient(); | 32 ContentClient(); |
30 ~ContentClient(); | 33 ~ContentClient(); |
31 | 34 |
32 ContentBrowserClient* browser() { return browser_; } | 35 ContentBrowserClient* browser() { return browser_; } |
33 void set_browser(ContentBrowserClient* c) { browser_ = c; } | 36 void set_browser(ContentBrowserClient* c) { browser_ = c; } |
34 ContentPluginClient* plugin() { return plugin_; } | 37 ContentPluginClient* plugin() { return plugin_; } |
35 void set_plugin(ContentPluginClient* r) { plugin_ = r; } | 38 void set_plugin(ContentPluginClient* r) { plugin_ = r; } |
36 ContentRendererClient* renderer() { return renderer_; } | 39 ContentRendererClient* renderer() { return renderer_; } |
37 void set_renderer(ContentRendererClient* r) { renderer_ = r; } | 40 void set_renderer(ContentRendererClient* r) { renderer_ = r; } |
38 | 41 |
39 // Sets the URL that is logged if the child process crashes. Use GURL() to | 42 // Sets the currently active URL. Use GURL() to clear the URL. |
40 // clear the URL. | |
41 virtual void SetActiveURL(const GURL& url) {} | 43 virtual void SetActiveURL(const GURL& url) {} |
42 | 44 |
43 // Sets the data on the current gpu. | 45 // Sets the data on the current gpu. |
44 virtual void SetGpuInfo(const GPUInfo& gpu_info) {} | 46 virtual void SetGpuInfo(const GPUInfo& gpu_info) {} |
45 | 47 |
| 48 // Gives the embedder a chance to register its own pepper plugins. |
| 49 virtual void AddPepperPlugins(std::vector<PepperPluginInfo>* plugins) {} |
| 50 |
46 private: | 51 private: |
47 // The embedder API for participating in browser logic. | 52 // The embedder API for participating in browser logic. |
48 ContentBrowserClient* browser_; | 53 ContentBrowserClient* browser_; |
49 // The embedder API for participating in plugin logic. | 54 // The embedder API for participating in plugin logic. |
50 ContentPluginClient* plugin_; | 55 ContentPluginClient* plugin_; |
51 // The embedder API for participating in renderer logic. | 56 // The embedder API for participating in renderer logic. |
52 ContentRendererClient* renderer_; | 57 ContentRendererClient* renderer_; |
53 }; | 58 }; |
54 | 59 |
55 } // namespace content | 60 } // namespace content |
56 | 61 |
57 #endif // CONTENT_COMMON_CONTENT_CLIENT_H_ | 62 #endif // CONTENT_COMMON_CONTENT_CLIENT_H_ |
OLD | NEW |