| 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/sequenced_task_runner_helpers.h" | 11 #include "base/sequenced_task_runner_helpers.h" |
| 12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
| 13 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
| 14 #endif | 14 #endif |
| 15 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" | 15 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" |
| 16 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" | 16 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" |
| 17 #include "content/renderer/render_view_impl.h" | 17 #include "content/renderer/render_view_impl.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" |
| 19 | 19 |
| 20 struct BrowserPluginHostMsg_ResizeGuest_Params; | 20 struct BrowserPluginHostMsg_ResizeGuest_Params; |
| 21 struct BrowserPluginMsg_DidNavigate_Params; | |
| 22 struct BrowserPluginMsg_UpdateRect_Params; | 21 struct BrowserPluginMsg_UpdateRect_Params; |
| 23 | 22 |
| 24 namespace content { | 23 namespace content { |
| 25 | 24 |
| 26 class BrowserPluginManager; | 25 class BrowserPluginManager; |
| 27 class MockBrowserPlugin; | 26 class MockBrowserPlugin; |
| 28 | 27 |
| 29 class CONTENT_EXPORT BrowserPlugin : | 28 class CONTENT_EXPORT BrowserPlugin : |
| 30 NON_EXPORTED_BASE(public WebKit::WebPlugin) { | 29 NON_EXPORTED_BASE(public WebKit::WebPlugin) { |
| 31 public: | 30 public: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 51 // set appropriately to indicate the failure reason. | 50 // set appropriately to indicate the failure reason. |
| 52 bool SetPartitionAttribute(const std::string& partition_id, | 51 bool SetPartitionAttribute(const std::string& partition_id, |
| 53 std::string& error_message); | 52 std::string& error_message); |
| 54 | 53 |
| 55 // Inform the BrowserPlugin to update its backing store with the pixels in | 54 // Inform the BrowserPlugin to update its backing store with the pixels in |
| 56 // its damage buffer. | 55 // its damage buffer. |
| 57 void UpdateRect(int message_id, | 56 void UpdateRect(int message_id, |
| 58 const BrowserPluginMsg_UpdateRect_Params& params); | 57 const BrowserPluginMsg_UpdateRect_Params& params); |
| 59 // Inform the BrowserPlugin that its guest has crashed. | 58 // Inform the BrowserPlugin that its guest has crashed. |
| 60 void GuestCrashed(); | 59 void GuestCrashed(); |
| 61 // Informs the BrowserPlugin that the guest has navigated to a new URL. | 60 |
| 62 void DidNavigate(const BrowserPluginMsg_DidNavigate_Params& params); | |
| 63 // Inform the BrowserPlugin that the guest has started loading a new page. | 61 // Inform the BrowserPlugin that the guest has started loading a new page. |
| 64 void LoadStart(const GURL& url, bool is_top_level); | 62 void LoadStart(const GURL& url, bool is_top_level); |
| 63 // Inform the BrowserPlugin that the guest has navigated to a new URL. |
| 64 void LoadCommit(const GURL& url, int process_id, bool is_top_level); |
| 65 // Inform the BrowserPlugin that the guest has finished loading a new page. |
| 66 void LoadStop(); |
| 65 // Inform the BrowserPlugin that the guest has aborted loading a new page. | 67 // Inform the BrowserPlugin that the guest has aborted loading a new page. |
| 66 void LoadAbort(const GURL& url, bool is_top_level, const std::string& type); | 68 void LoadAbort(const GURL& url, bool is_top_level, const std::string& type); |
| 67 // Inform the BrowserPlugin that the guest has redirected a navigation. | 69 // Inform the BrowserPlugin that the guest has redirected a navigation. |
| 68 void LoadRedirect(const GURL& old_url, | 70 void LoadRedirect(const GURL& old_url, |
| 69 const GURL& new_url, | 71 const GURL& new_url, |
| 70 bool is_top_level); | 72 bool is_top_level); |
| 71 // Tells the BrowserPlugin to advance the focus to the next (or previous) | 73 // Tells the BrowserPlugin to advance the focus to the next (or previous) |
| 72 // element. | 74 // element. |
| 73 void AdvanceFocus(bool reverse); | 75 void AdvanceFocus(bool reverse); |
| 74 | |
| 75 // Informs the BrowserPlugin that the guest has started/stopped accepting | 76 // Informs the BrowserPlugin that the guest has started/stopped accepting |
| 76 // touch events. | 77 // touch events. |
| 77 void SetAcceptTouchEvents(bool accept); | 78 void SetAcceptTouchEvents(bool accept); |
| 78 | 79 |
| 79 // Indicates whether there are any Javascript listeners attached to a | 80 // Indicates whether there are any Javascript listeners attached to a |
| 80 // provided event_name. | 81 // provided event_name. |
| 81 bool HasListeners(const std::string& event_name); | 82 bool HasListeners(const std::string& event_name); |
| 82 // Add a custom event listener to this BrowserPlugin instance. | 83 // Add a custom event listener to this BrowserPlugin instance. |
| 83 bool AddEventListener(const std::string& event_name, | 84 bool AddEventListener(const std::string& event_name, |
| 84 v8::Local<v8::Function> function); | 85 v8::Local<v8::Function> function); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // the changes are not always obvious. For example, there is a maximum | 223 // the changes are not always obvious. For example, there is a maximum |
| 223 // number of entries and earlier ones will automatically be pruned. | 224 // number of entries and earlier ones will automatically be pruned. |
| 224 int current_nav_entry_index_; | 225 int current_nav_entry_index_; |
| 225 int nav_entry_count_; | 226 int nav_entry_count_; |
| 226 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 227 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
| 227 }; | 228 }; |
| 228 | 229 |
| 229 } // namespace content | 230 } // namespace content |
| 230 | 231 |
| 231 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 232 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| OLD | NEW |