| 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_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 7 | 7 |
| 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
| 13 #include "base/sequenced_task_runner_helpers.h" | 13 #include "base/sequenced_task_runner_helpers.h" |
| 14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 15 #include "base/shared_memory.h" | 15 #include "base/shared_memory.h" |
| 16 #endif | 16 #endif |
| 17 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" | 17 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" |
| 18 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" | 18 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" |
| 19 #include "content/renderer/render_view_impl.h" | 19 #include "content/renderer/render_view_impl.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" |
| 21 | 21 |
| 22 struct BrowserPluginHostMsg_ResizeGuest_Params; | 22 struct BrowserPluginHostMsg_ResizeGuest_Params; |
| 23 struct BrowserPluginMsg_LoadCommit_Params; | 23 struct BrowserPluginMsg_LoadCommit_Params; |
| 24 struct BrowserPluginMsg_UpdateRect_Params; | 24 struct BrowserPluginMsg_UpdateRect_Params; |
| 25 | 25 |
| 26 namespace gfx { |
| 27 class Size; |
| 28 } |
| 29 |
| 26 namespace content { | 30 namespace content { |
| 27 | 31 |
| 28 class BrowserPluginManager; | 32 class BrowserPluginManager; |
| 33 class BrowserPluginTextureProvider; |
| 29 class MockBrowserPlugin; | 34 class MockBrowserPlugin; |
| 30 | 35 |
| 31 class CONTENT_EXPORT BrowserPlugin : | 36 class CONTENT_EXPORT BrowserPlugin : |
| 32 NON_EXPORTED_BASE(public WebKit::WebPlugin) { | 37 NON_EXPORTED_BASE(public WebKit::WebPlugin) { |
| 33 public: | 38 public: |
| 34 // Called only by tests to clean up before we blow away the MockRenderProcess. | 39 // Called only by tests to clean up before we blow away the MockRenderProcess. |
| 35 void Cleanup(); | 40 void Cleanup(); |
| 36 | 41 |
| 37 // Get the src attribute value of the BrowserPlugin instance if the guest | 42 // Get the src attribute value of the BrowserPlugin instance if the guest |
| 38 // has not crashed. | 43 // has not crashed. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // Tells the BrowserPlugin to tell the guest to navigate to a position | 109 // Tells the BrowserPlugin to tell the guest to navigate to a position |
| 105 // relative to the current index in its navigation history. | 110 // relative to the current index in its navigation history. |
| 106 void Go(int relativeIndex); | 111 void Go(int relativeIndex); |
| 107 // Tells the BrowserPlugin to terminate the guest process. | 112 // Tells the BrowserPlugin to terminate the guest process. |
| 108 void TerminateGuest(); | 113 void TerminateGuest(); |
| 109 | 114 |
| 110 // A request from Javascript has been made to stop the loading of the page. | 115 // A request from Javascript has been made to stop the loading of the page. |
| 111 void Stop(); | 116 void Stop(); |
| 112 // A request from Javascript has been made to reload the page. | 117 // A request from Javascript has been made to reload the page. |
| 113 void Reload(); | 118 void Reload(); |
| 119 // A request to enable hardware compositing. |
| 120 void EnableCompositing(); |
| 121 // Initialized the texture provider used for compositing. |
| 122 void InitializeTextureProvider(); |
| 123 // Provide HW compositing info if we have a context, reset otherwise. |
| 124 void ProvideHWCompositingInfo(BrowserPluginHostMsg_ResizeGuest_Params*, |
| 125 WebGraphicsContext3DCommandBufferImpl*); |
| 114 | 126 |
| 115 // WebKit::WebPlugin implementation. | 127 // WebKit::WebPlugin implementation. |
| 116 virtual WebKit::WebPluginContainer* container() const OVERRIDE; | 128 virtual WebKit::WebPluginContainer* container() const OVERRIDE; |
| 117 virtual bool initialize(WebKit::WebPluginContainer* container) OVERRIDE; | 129 virtual bool initialize(WebKit::WebPluginContainer* container) OVERRIDE; |
| 118 virtual void destroy() OVERRIDE; | 130 virtual void destroy() OVERRIDE; |
| 119 virtual NPObject* scriptableObject() OVERRIDE; | 131 virtual NPObject* scriptableObject() OVERRIDE; |
| 120 virtual bool supportsKeyboardFocus() const OVERRIDE; | 132 virtual bool supportsKeyboardFocus() const OVERRIDE; |
| 121 virtual bool canProcessDrag() const OVERRIDE; | 133 virtual bool canProcessDrag() const OVERRIDE; |
| 122 virtual void paint( | 134 virtual void paint( |
| 123 WebKit::WebCanvas* canvas, | 135 WebKit::WebCanvas* canvas, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // in the embedder process, at the risk of having incorrect information that | 257 // in the embedder process, at the risk of having incorrect information that |
| 246 // can lead to broken back/forward logic in apps. | 258 // can lead to broken back/forward logic in apps. |
| 247 // It's also important that this state does not get modified by any logic in | 259 // It's also important that this state does not get modified by any logic in |
| 248 // the embedder process. It should only be updated in response to navigation | 260 // the embedder process. It should only be updated in response to navigation |
| 249 // events in the guest. No assumptions should be made about how the index | 261 // events in the guest. No assumptions should be made about how the index |
| 250 // will change after a navigation (e.g., for back, forward, or go), because | 262 // will change after a navigation (e.g., for back, forward, or go), because |
| 251 // the changes are not always obvious. For example, there is a maximum | 263 // the changes are not always obvious. For example, there is a maximum |
| 252 // number of entries and earlier ones will automatically be pruned. | 264 // number of entries and earlier ones will automatically be pruned. |
| 253 int current_nav_entry_index_; | 265 int current_nav_entry_index_; |
| 254 int nav_entry_count_; | 266 int nav_entry_count_; |
| 267 |
| 268 // Used for HW compositing. |
| 269 BrowserPluginTextureProvider* provider_; |
| 270 bool compositingPossible_; |
| 271 bool compositingEnabled_; |
| 255 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 272 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
| 256 }; | 273 }; |
| 257 | 274 |
| 258 } // namespace content | 275 } // namespace content |
| 259 | 276 |
| 260 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 277 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| OLD | NEW |