| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 class ContentClient; | 37 class ContentClient; |
| 38 class ContentPluginClient; | 38 class ContentPluginClient; |
| 39 class ContentRendererClient; | 39 class ContentRendererClient; |
| 40 class ContentUtilityClient; | 40 class ContentUtilityClient; |
| 41 | 41 |
| 42 // Setter and getter for the client. The client should be set early, before any | 42 // Setter and getter for the client. The client should be set early, before any |
| 43 // content code is called. | 43 // content code is called. |
| 44 CONTENT_EXPORT void SetContentClient(ContentClient* client); | 44 CONTENT_EXPORT void SetContentClient(ContentClient* client); |
| 45 CONTENT_EXPORT ContentClient* GetContentClient(); | 45 CONTENT_EXPORT ContentClient* GetContentClient(); |
| 46 | 46 |
| 47 // Returns the user agent string being used by the browser. SetContentClient() |
| 48 // must be called prior to calling this, and this routine must be used |
| 49 // instead of webkit_glue::GetUserAgent() in order to ensure that we use |
| 50 // the same user agent string everywhere. |
| 51 // TODO(dpranke): This is caused by webkit_glue being a library that can |
| 52 // get linked into multiple linkable objects, causing us to have multiple |
| 53 // static values of the user agent. This will be fixed when we clean up |
| 54 // webkit_glue. |
| 55 CONTENT_EXPORT const std::string& GetUserAgent(const GURL& url); |
| 56 |
| 47 // Interface that the embedder implements. | 57 // Interface that the embedder implements. |
| 48 class CONTENT_EXPORT ContentClient { | 58 class CONTENT_EXPORT ContentClient { |
| 49 public: | 59 public: |
| 50 ContentClient(); | 60 ContentClient(); |
| 51 virtual ~ContentClient(); | 61 virtual ~ContentClient(); |
| 52 | 62 |
| 53 ContentBrowserClient* browser() { return browser_; } | 63 ContentBrowserClient* browser() { return browser_; } |
| 54 void set_browser(ContentBrowserClient* c) { browser_ = c; } | 64 void set_browser(ContentBrowserClient* c) { browser_ = c; } |
| 55 ContentPluginClient* plugin() { return plugin_; } | 65 ContentPluginClient* plugin() { return plugin_; } |
| 56 void set_plugin(ContentPluginClient* p) { plugin_ = p; } | 66 void set_plugin(ContentPluginClient* p) { plugin_ = p; } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 ContentPluginClient* plugin_; | 110 ContentPluginClient* plugin_; |
| 101 // The embedder API for participating in renderer logic. | 111 // The embedder API for participating in renderer logic. |
| 102 ContentRendererClient* renderer_; | 112 ContentRendererClient* renderer_; |
| 103 // The embedder API for participating in utility logic. | 113 // The embedder API for participating in utility logic. |
| 104 ContentUtilityClient* utility_; | 114 ContentUtilityClient* utility_; |
| 105 }; | 115 }; |
| 106 | 116 |
| 107 } // namespace content | 117 } // namespace content |
| 108 | 118 |
| 109 #endif // CONTENT_COMMON_CONTENT_CLIENT_H_ | 119 #endif // CONTENT_COMMON_CONTENT_CLIENT_H_ |
| OLD | NEW |