| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 ContentBrowserClient* browser() { return browser_; } | 52 ContentBrowserClient* browser() { return browser_; } |
| 53 void set_browser(ContentBrowserClient* c) { browser_ = c; } | 53 void set_browser(ContentBrowserClient* c) { browser_ = c; } |
| 54 ContentPluginClient* plugin() { return plugin_; } | 54 ContentPluginClient* plugin() { return plugin_; } |
| 55 void set_plugin(ContentPluginClient* p) { plugin_ = p; } | 55 void set_plugin(ContentPluginClient* p) { plugin_ = p; } |
| 56 ContentRendererClient* renderer() { return renderer_; } | 56 ContentRendererClient* renderer() { return renderer_; } |
| 57 void set_renderer(ContentRendererClient* r) { renderer_ = r; } | 57 void set_renderer(ContentRendererClient* r) { renderer_ = r; } |
| 58 ContentUtilityClient* utility() { return utility_; } | 58 ContentUtilityClient* utility() { return utility_; } |
| 59 void set_utility(ContentUtilityClient* u) { utility_ = u; } | 59 void set_utility(ContentUtilityClient* u) { utility_ = u; } |
| 60 | 60 |
| 61 // Sets the currently active URL. Use GURL() to clear the URL. | 61 // Sets the currently active URL. Use GURL() to clear the URL. |
| 62 virtual void SetActiveURL(const GURL& url) {} | 62 virtual void SetActiveURL(const GURL& url) = 0; |
| 63 | 63 |
| 64 // Sets the data on the current gpu. | 64 // Sets the data on the current gpu. |
| 65 virtual void SetGpuInfo(const GPUInfo& gpu_info) {} | 65 virtual void SetGpuInfo(const GPUInfo& gpu_info) = 0; |
| 66 | 66 |
| 67 // Gives the embedder a chance to register its own pepper plugins. | 67 // Gives the embedder a chance to register its own pepper plugins. |
| 68 virtual void AddPepperPlugins(std::vector<PepperPluginInfo>* plugins) {} | 68 virtual void AddPepperPlugins(std::vector<PepperPluginInfo>* plugins) = 0; |
| 69 | 69 |
| 70 // Returns whether the given message should be allowed to be sent from a | 70 // Returns whether the given message should be allowed to be sent from a |
| 71 // swapped out renderer. | 71 // swapped out renderer. |
| 72 virtual bool CanSendWhileSwappedOut(const IPC::Message* msg); | 72 virtual bool CanSendWhileSwappedOut(const IPC::Message* msg) = 0; |
| 73 | 73 |
| 74 // Returns whether the given message should be processed in the browser on | 74 // Returns whether the given message should be processed in the browser on |
| 75 // behalf of a swapped out renderer. | 75 // behalf of a swapped out renderer. |
| 76 virtual bool CanHandleWhileSwappedOut(const IPC::Message& msg); | 76 virtual bool CanHandleWhileSwappedOut(const IPC::Message& msg) = 0; |
| 77 | 77 |
| 78 // Returns the user agent. If mimic_windows is true then the embedder can | 78 // Returns the user agent. If mimic_windows is true then the embedder can |
| 79 // return a fake Windows user agent. This is a workaround for broken | 79 // return a fake Windows user agent. This is a workaround for broken |
| 80 // websites. | 80 // websites. |
| 81 virtual std::string GetUserAgent(bool mimic_windows) const; | 81 virtual std::string GetUserAgent(bool mimic_windows) const = 0; |
| 82 | 82 |
| 83 // Returns a string resource given its id. | 83 // Returns a string resource given its id. |
| 84 virtual string16 GetLocalizedString(int message_id) const; | 84 virtual string16 GetLocalizedString(int message_id) const = 0; |
| 85 | 85 |
| 86 // Return the contents of a resource in a StringPiece given the resource id. | 86 // Return the contents of a resource in a StringPiece given the resource id. |
| 87 virtual base::StringPiece GetDataResource(int resource_id) const; | 87 virtual base::StringPiece GetDataResource(int resource_id) const = 0; |
| 88 | 88 |
| 89 #if defined(OS_WIN) | 89 #if defined(OS_WIN) |
| 90 // Allows the embedder to sandbox a plugin, and apply a custom policy. | 90 // Allows the embedder to sandbox a plugin, and apply a custom policy. |
| 91 virtual bool SandboxPlugin(CommandLine* command_line, | 91 virtual bool SandboxPlugin(CommandLine* command_line, |
| 92 sandbox::TargetPolicy* policy); | 92 sandbox::TargetPolicy* policy) = 0; |
| 93 #endif | 93 #endif |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 // The embedder API for participating in browser logic. | 96 // The embedder API for participating in browser logic. |
| 97 ContentBrowserClient* browser_; | 97 ContentBrowserClient* browser_; |
| 98 // The embedder API for participating in plugin logic. | 98 // The embedder API for participating in plugin logic. |
| 99 ContentPluginClient* plugin_; | 99 ContentPluginClient* plugin_; |
| 100 // The embedder API for participating in renderer logic. | 100 // The embedder API for participating in renderer logic. |
| 101 ContentRendererClient* renderer_; | 101 ContentRendererClient* renderer_; |
| 102 // The embedder API for participating in utility logic. | 102 // The embedder API for participating in utility logic. |
| 103 ContentUtilityClient* utility_; | 103 ContentUtilityClient* utility_; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace content | 106 } // namespace content |
| 107 | 107 |
| 108 #endif // CONTENT_COMMON_CONTENT_CLIENT_H_ | 108 #endif // CONTENT_COMMON_CONTENT_CLIENT_H_ |
| OLD | NEW |