OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_RENDER_FRAME_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ |
6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Returns the ServiceRegistry for this frame. | 123 // Returns the ServiceRegistry for this frame. |
124 virtual ServiceRegistry* GetServiceRegistry() = 0; | 124 virtual ServiceRegistry* GetServiceRegistry() = 0; |
125 | 125 |
126 #if defined(ENABLE_PLUGINS) | 126 #if defined(ENABLE_PLUGINS) |
127 // Registers a plugin that has been marked peripheral. If the origin | 127 // Registers a plugin that has been marked peripheral. If the origin |
128 // whitelist is later updated and includes |content_origin|, then | 128 // whitelist is later updated and includes |content_origin|, then |
129 // |unthrottle_callback| will be called. | 129 // |unthrottle_callback| will be called. |
130 virtual void RegisterPeripheralPlugin( | 130 virtual void RegisterPeripheralPlugin( |
131 const url::Origin& content_origin, | 131 const url::Origin& content_origin, |
132 const base::Closure& unthrottle_callback) = 0; | 132 const base::Closure& unthrottle_callback) = 0; |
| 133 |
| 134 // Returns true if this plugin should have power saver enabled. |
| 135 // |
| 136 // Power Saver is enabled for plugin content that are cross-origin and |
| 137 // heuristically determined to be not essential to the web page content. |
| 138 // |
| 139 // Plugin content is defined to be cross-origin when the plugin source's |
| 140 // origin differs from the top level frame's origin. For example: |
| 141 // - Cross-origin: a.com -> b.com/plugin.swf |
| 142 // - Cross-origin: a.com -> b.com/iframe.html -> b.com/plugin.swf |
| 143 // - Same-origin: a.com -> b.com/iframe-to-a.html -> a.com/plugin.swf |
| 144 // |
| 145 // |main_frame_origin| is the origin of the main frame. |
| 146 // |
| 147 // |content_origin| is the origin of the plugin content. |
| 148 // |
| 149 // |width| and |height| are zoom and device scale independent logical pixels. |
| 150 // |
| 151 // |cross_origin_main_content| may be NULL. It is set to true if the |
| 152 // plugin content is cross-origin but still the "main attraction" of the page. |
| 153 virtual bool ShouldThrottleContent(const url::Origin& main_frame_origin, |
| 154 const url::Origin& content_origin, |
| 155 const std::string& plugin_module_name, |
| 156 int width, |
| 157 int height, |
| 158 bool* cross_origin_main_content) const = 0; |
| 159 |
| 160 // Whitelists a |content_origin| so its content will never be throttled in |
| 161 // this RenderFrame. Whitelist is cleared by top level navigation. |
| 162 virtual void WhitelistContentOrigin(const url::Origin& content_origin) = 0; |
133 #endif | 163 #endif |
134 | 164 |
135 // Returns true if this frame is a FTP directory listing. | 165 // Returns true if this frame is a FTP directory listing. |
136 virtual bool IsFTPDirectoryListing() = 0; | 166 virtual bool IsFTPDirectoryListing() = 0; |
137 | 167 |
138 // Attaches the browser plugin identified by |element_instance_id| to guest | 168 // Attaches the browser plugin identified by |element_instance_id| to guest |
139 // content created by the embedder. | 169 // content created by the embedder. |
140 virtual void AttachGuest(int element_instance_id) = 0; | 170 virtual void AttachGuest(int element_instance_id) = 0; |
141 | 171 |
142 // Detaches the browser plugin identified by |element_instance_id| from guest | 172 // Detaches the browser plugin identified by |element_instance_id| from guest |
(...skipping 19 matching lines...) Expand all Loading... |
162 | 192 |
163 private: | 193 private: |
164 // This interface should only be implemented inside content. | 194 // This interface should only be implemented inside content. |
165 friend class RenderFrameImpl; | 195 friend class RenderFrameImpl; |
166 RenderFrame() {} | 196 RenderFrame() {} |
167 }; | 197 }; |
168 | 198 |
169 } // namespace content | 199 } // namespace content |
170 | 200 |
171 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ | 201 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ |
OLD | NEW |