Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 6 #define CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 | 57 |
| 58 // Used for tests to override the relevant embedder interfaces. Each method | 58 // Used for tests to override the relevant embedder interfaces. Each method |
| 59 // returns the old value. | 59 // returns the old value. |
| 60 CONTENT_EXPORT ContentBrowserClient* SetBrowserClientForTesting( | 60 CONTENT_EXPORT ContentBrowserClient* SetBrowserClientForTesting( |
| 61 ContentBrowserClient* b); | 61 ContentBrowserClient* b); |
| 62 CONTENT_EXPORT ContentRendererClient* SetRendererClientForTesting( | 62 CONTENT_EXPORT ContentRendererClient* SetRendererClientForTesting( |
| 63 ContentRendererClient* r); | 63 ContentRendererClient* r); |
| 64 CONTENT_EXPORT ContentUtilityClient* SetUtilityClientForTesting( | 64 CONTENT_EXPORT ContentUtilityClient* SetUtilityClientForTesting( |
| 65 ContentUtilityClient* u); | 65 ContentUtilityClient* u); |
| 66 | 66 |
| 67 struct CONTENT_EXPORT WebUITextStyles { | |
|
davidben
2014/11/25 22:26:25
Should this be in its own header? It's pretty tiny
Dan Beam
2014/11/25 22:49:31
Deleted.
| |
| 68 // One or more font families (e.g. "Verdana, sans-serif"). | |
| 69 std::string font_family; | |
| 70 | |
| 71 // The base font size for webui pages (e.g. "75%"). | |
| 72 std::string font_size; | |
| 73 | |
| 74 // Text directionality (e.g. "ltr" or "rtl"). | |
| 75 std::string text_direction; | |
| 76 }; | |
| 77 | |
| 67 // Interface that the embedder implements. | 78 // Interface that the embedder implements. |
| 68 class CONTENT_EXPORT ContentClient { | 79 class CONTENT_EXPORT ContentClient { |
| 69 public: | 80 public: |
| 70 ContentClient(); | 81 ContentClient(); |
| 71 virtual ~ContentClient(); | 82 virtual ~ContentClient(); |
| 72 | 83 |
| 73 ContentBrowserClient* browser() { return browser_; } | 84 ContentBrowserClient* browser() { return browser_; } |
| 74 ContentPluginClient* plugin() { return plugin_; } | 85 ContentPluginClient* plugin() { return plugin_; } |
| 75 ContentRendererClient* renderer() { return renderer_; } | 86 ContentRendererClient* renderer() { return renderer_; } |
| 76 ContentUtilityClient* utility() { return utility_; } | 87 ContentUtilityClient* utility() { return utility_; } |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 107 | 118 |
| 108 // Return the contents of a resource in a StringPiece given the resource id. | 119 // Return the contents of a resource in a StringPiece given the resource id. |
| 109 virtual base::StringPiece GetDataResource( | 120 virtual base::StringPiece GetDataResource( |
| 110 int resource_id, | 121 int resource_id, |
| 111 ui::ScaleFactor scale_factor) const; | 122 ui::ScaleFactor scale_factor) const; |
| 112 | 123 |
| 113 // Returns the raw bytes of a scale independent data resource. | 124 // Returns the raw bytes of a scale independent data resource. |
| 114 virtual base::RefCountedStaticMemory* GetDataResourceBytes( | 125 virtual base::RefCountedStaticMemory* GetDataResourceBytes( |
| 115 int resource_id) const; | 126 int resource_id) const; |
| 116 | 127 |
| 128 // Returns some shared WebUI text styles. These map to the direction:, | |
| 129 // font-family:, and font-size: attributes in CSS. | |
| 130 virtual WebUITextStyles GetWebUITextStyles() const; | |
|
davidben
2014/11/25 22:26:25
Actually, is this hook even needed? The Chrome imp
Dan Beam
2014/11/25 22:49:31
Removed to just use ui/base/webui/ directly from c
| |
| 131 | |
| 117 // Returns a native image given its id. | 132 // Returns a native image given its id. |
| 118 virtual gfx::Image& GetNativeImageNamed(int resource_id) const; | 133 virtual gfx::Image& GetNativeImageNamed(int resource_id) const; |
| 119 | 134 |
| 120 // Called by content::GetProcessTypeNameInEnglish for process types that it | 135 // Called by content::GetProcessTypeNameInEnglish for process types that it |
| 121 // doesn't know about because they're from the embedder. | 136 // doesn't know about because they're from the embedder. |
| 122 virtual std::string GetProcessTypeNameInEnglish(int type); | 137 virtual std::string GetProcessTypeNameInEnglish(int type); |
| 123 | 138 |
| 124 #if defined(OS_MACOSX) && !defined(OS_IOS) | 139 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 125 // Allows the embedder to define a new |sandbox_type| by mapping it to the | 140 // Allows the embedder to define a new |sandbox_type| by mapping it to the |
| 126 // resource ID corresponding to the sandbox profile to use. The legal values | 141 // resource ID corresponding to the sandbox profile to use. The legal values |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 144 ContentPluginClient* plugin_; | 159 ContentPluginClient* plugin_; |
| 145 // The embedder API for participating in renderer logic. | 160 // The embedder API for participating in renderer logic. |
| 146 ContentRendererClient* renderer_; | 161 ContentRendererClient* renderer_; |
| 147 // The embedder API for participating in utility logic. | 162 // The embedder API for participating in utility logic. |
| 148 ContentUtilityClient* utility_; | 163 ContentUtilityClient* utility_; |
| 149 }; | 164 }; |
| 150 | 165 |
| 151 } // namespace content | 166 } // namespace content |
| 152 | 167 |
| 153 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 168 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
| OLD | NEW |