| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // Returns the ServiceRegistry for this frame. | 113 // Returns the ServiceRegistry for this frame. |
| 114 virtual ServiceRegistry* GetServiceRegistry() = 0; | 114 virtual ServiceRegistry* GetServiceRegistry() = 0; |
| 115 | 115 |
| 116 #if defined(ENABLE_PLUGINS) | 116 #if defined(ENABLE_PLUGINS) |
| 117 // Registers a plugin that has been marked peripheral. If the origin | 117 // Registers a plugin that has been marked peripheral. If the origin |
| 118 // whitelist is later updated and includes |content_origin|, then | 118 // whitelist is later updated and includes |content_origin|, then |
| 119 // |unthrottle_callback| will be called. | 119 // |unthrottle_callback| will be called. |
| 120 virtual void RegisterPeripheralPlugin( | 120 virtual void RegisterPeripheralPlugin( |
| 121 const GURL& content_origin, | 121 const GURL& content_origin, |
| 122 const base::Closure& unthrottle_callback) = 0; | 122 const base::Closure& unthrottle_callback) = 0; |
| 123 | |
| 124 // Returns true if this plugin should have power saver enabled. | |
| 125 // | |
| 126 // Power Saver is enabled for plugin content that are cross-origin and | |
| 127 // heuristically determined to be not essential to the web page content. | |
| 128 // | |
| 129 // Plugin content is defined to be cross-origin when the plugin source's | |
| 130 // origin differs from the top level frame's origin. For example: | |
| 131 // - Cross-origin: a.com -> b.com/plugin.swf | |
| 132 // - Cross-origin: a.com -> b.com/iframe.html -> b.com/plugin.swf | |
| 133 // - Same-origin: a.com -> b.com/iframe-to-a.html -> a.com/plugin.swf | |
| 134 // | |
| 135 // |page_frame_url| is the URL of the frame containing the plugin, which may | |
| 136 // be different from the URL of the top level document. | |
| 137 // | |
| 138 // |poster_image| may be NULL. It is set to the absolute URL of the poster | |
| 139 // image if it exists and this method returns true. Otherwise, an empty GURL. | |
| 140 // | |
| 141 // |cross_origin_main_content| may be NULL. It is set to true if the | |
| 142 // plugin content is cross-origin but still the "main attraction" of the page. | |
| 143 virtual bool ShouldThrottleContent(const blink::WebPluginParams& params, | |
| 144 const GURL& page_frame_url, | |
| 145 GURL* poster_image, | |
| 146 bool* cross_origin_main_content) const = 0; | |
| 147 | |
| 148 // Whitelists a |content_origin| so its content will never be throttled in | |
| 149 // this RenderFrame. Whitelist is cleared by top level navigation. | |
| 150 virtual void WhitelistContentOrigin(const GURL& content_origin) = 0; | |
| 151 #endif | 123 #endif |
| 152 | 124 |
| 153 // Returns true if this frame is a FTP directory listing. | 125 // Returns true if this frame is a FTP directory listing. |
| 154 virtual bool IsFTPDirectoryListing() = 0; | 126 virtual bool IsFTPDirectoryListing() = 0; |
| 155 | 127 |
| 156 // Attaches the browser plugin identified by |element_instance_id| to guest | 128 // Attaches the browser plugin identified by |element_instance_id| to guest |
| 157 // content created by the embedder. | 129 // content created by the embedder. |
| 158 virtual void AttachGuest(int element_instance_id) = 0; | 130 virtual void AttachGuest(int element_instance_id) = 0; |
| 159 | 131 |
| 160 // Detaches the browser plugin identified by |element_instance_id| from guest | 132 // Detaches the browser plugin identified by |element_instance_id| from guest |
| (...skipping 15 matching lines...) Expand all Loading... |
| 176 | 148 |
| 177 private: | 149 private: |
| 178 // This interface should only be implemented inside content. | 150 // This interface should only be implemented inside content. |
| 179 friend class RenderFrameImpl; | 151 friend class RenderFrameImpl; |
| 180 RenderFrame() {} | 152 RenderFrame() {} |
| 181 }; | 153 }; |
| 182 | 154 |
| 183 } // namespace content | 155 } // namespace content |
| 184 | 156 |
| 185 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ | 157 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ |
| OLD | NEW |