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 "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "content/browser/content_browser_client.h" | |
12 | 11 |
| 12 class ContentBrowserClient; |
13 class GURL; | 13 class GURL; |
14 struct GPUInfo; | 14 struct GPUInfo; |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 class ContentClient; | 18 class ContentClient; |
19 // Setter and getter for the client. The client should be set early, before any | 19 // Setter and getter for the client. The client should be set early, before any |
20 // content code is called. | 20 // content code is called. |
21 void SetContentClient(ContentClient* client); | 21 void SetContentClient(ContentClient* client); |
22 ContentClient* GetContentClient(); | 22 ContentClient* GetContentClient(); |
23 | 23 |
24 // Interface that the embedder implements. | 24 // Interface that the embedder implements. |
25 class ContentClient { | 25 class ContentClient { |
26 public: | 26 public: |
27 ContentClient(); | 27 ContentClient(); |
28 ~ContentClient(); | 28 ~ContentClient(); |
29 | 29 |
30 // Gets or sets the embedder API for participating in browser logic. | 30 // Gets or sets the embedder API for participating in browser logic. |
31 // The client must be set early, before any content code is called. | 31 // The client must be set early, before any content code is called. |
32 ContentBrowserClient* browser_client() { | 32 ContentBrowserClient* browser_client() { |
33 return browser_client_.get(); | 33 return browser_client_; |
34 } | 34 } |
35 void set_browser_client(ContentBrowserClient* client) { | 35 void set_browser_client(ContentBrowserClient* client) { |
36 browser_client_.reset(client); | 36 browser_client_ = client; |
37 } | 37 } |
38 | 38 |
39 // Sets the URL that is logged if the child process crashes. Use GURL() to | 39 // Sets the URL that is logged if the child process crashes. Use GURL() to |
40 // clear the URL. | 40 // clear the URL. |
41 virtual void SetActiveURL(const GURL& url) {} | 41 virtual void SetActiveURL(const GURL& url) {} |
42 | 42 |
43 // Sets the data on the gpu to send along with crash reports. | 43 // Sets the data on the gpu to send along with crash reports. |
44 virtual void SetGpuInfo(const GPUInfo& gpu_info) {} | 44 virtual void SetGpuInfo(const GPUInfo& gpu_info) {} |
45 | 45 |
| 46 // Notifies that a plugin process has started. |
| 47 virtual void PluginProcessStarted() {} |
| 48 |
46 private: | 49 private: |
47 scoped_ptr<ContentBrowserClient> browser_client_; | 50 ContentBrowserClient* browser_client_; |
48 }; | 51 }; |
49 | 52 |
50 } // namespace content | 53 } // namespace content |
51 | 54 |
52 #endif // CONTENT_COMMON_CONTENT_CLIENT_H_ | 55 #endif // CONTENT_COMMON_CONTENT_CLIENT_H_ |
OLD | NEW |