Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.h

Issue 10829225: Browser Plugin: Add HTML5-like postMessage support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT. Addressed creis@'s comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 20 matching lines...) Expand all
31 public: 31 public:
32 // Called only by tests to clean up before we blow away the MockRenderProcess. 32 // Called only by tests to clean up before we blow away the MockRenderProcess.
33 void Cleanup(); 33 void Cleanup();
34 34
35 // Get the src attribute value of the BrowserPlugin instance if the guest 35 // Get the src attribute value of the BrowserPlugin instance if the guest
36 // has not crashed. 36 // has not crashed.
37 std::string GetSrcAttribute() const; 37 std::string GetSrcAttribute() const;
38 // Set the src attribute value of the BrowserPlugin instance and reset 38 // Set the src attribute value of the BrowserPlugin instance and reset
39 // the guest_crashed_ flag. 39 // the guest_crashed_ flag.
40 void SetSrcAttribute(const std::string& src); 40 void SetSrcAttribute(const std::string& src);
41 // Get the guest's DOMWindow proxy.
42 NPObject* GetContentWindow() const;
41 // Returns Chrome's process ID for the current guest. 43 // Returns Chrome's process ID for the current guest.
42 int process_id() const { return process_id_; } 44 int process_id() const { return process_id_; }
43 // The partition identifier string is stored as UTF-8. 45 // The partition identifier string is stored as UTF-8.
44 std::string GetPartitionAttribute() const; 46 std::string GetPartitionAttribute() const;
45 // Query whether the guest can navigate back to the previous entry. 47 // Query whether the guest can navigate back to the previous entry.
46 bool CanGoBack() const; 48 bool CanGoBack() const;
47 // Query whether the guest can navigation forward to the next entry. 49 // Query whether the guest can navigation forward to the next entry.
48 bool CanGoForward() const; 50 bool CanGoForward() const;
49 // This method can be successfully called only before the first navigation for 51 // This method can be successfully called only before the first navigation for
50 // this instance of BrowserPlugin. If an error occurs, the |error_message| is 52 // this instance of BrowserPlugin. If an error occurs, the |error_message| is
(...skipping 14 matching lines...) Expand all
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 76
77 // Inform the BrowserPlugin that the guest's contentWindow is ready,
78 // and provide it with a routing ID to grab it.
79 void GuestContentWindowReady(int content_window_routing_id);
80
75 // Informs the BrowserPlugin that the guest has started/stopped accepting 81 // Informs the BrowserPlugin that the guest has started/stopped accepting
76 // touch events. 82 // touch events.
77 void SetAcceptTouchEvents(bool accept); 83 void SetAcceptTouchEvents(bool accept);
78 84
79 // Indicates whether there are any Javascript listeners attached to a 85 // Indicates whether there are any Javascript listeners attached to a
80 // provided event_name. 86 // provided event_name.
81 bool HasListeners(const std::string& event_name); 87 bool HasListeners(const std::string& event_name);
82 // Add a custom event listener to this BrowserPlugin instance. 88 // Add a custom event listener to this BrowserPlugin instance.
83 bool AddEventListener(const std::string& event_name, 89 bool AddEventListener(const std::string& event_name,
84 v8::Local<v8::Function> function); 90 v8::Local<v8::Function> function);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 SkBitmap* sad_guest_; 201 SkBitmap* sad_guest_;
196 bool guest_crashed_; 202 bool guest_crashed_;
197 bool resize_pending_; 203 bool resize_pending_;
198 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> pending_resize_params_; 204 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> pending_resize_params_;
199 // True if we have ever sent a NavigateGuest message to the embedder. 205 // True if we have ever sent a NavigateGuest message to the embedder.
200 bool navigate_src_sent_; 206 bool navigate_src_sent_;
201 std::string src_; 207 std::string src_;
202 int process_id_; 208 int process_id_;
203 std::string storage_partition_id_; 209 std::string storage_partition_id_;
204 bool persist_storage_; 210 bool persist_storage_;
211 int content_window_routing_id_;
205 // Tracks the visibility of the browser plugin regardless of the whole 212 // Tracks the visibility of the browser plugin regardless of the whole
206 // embedder RenderView's visibility. 213 // embedder RenderView's visibility.
207 bool visible_; 214 bool visible_;
208 typedef std::vector<v8::Persistent<v8::Function> > EventListeners; 215 typedef std::vector<v8::Persistent<v8::Function> > EventListeners;
209 typedef std::map<std::string, EventListeners> EventListenerMap; 216 typedef std::map<std::string, EventListeners> EventListenerMap;
210 EventListenerMap event_listener_map_; 217 EventListenerMap event_listener_map_;
211 #if defined(OS_WIN) 218 #if defined(OS_WIN)
212 base::SharedMemory shared_memory_; 219 base::SharedMemory shared_memory_;
213 #endif 220 #endif
214 // Important: Do not add more history state here. 221 // Important: Do not add more history state here.
215 // We strongly discourage storing additional history state (such as page IDs) 222 // We strongly discourage storing additional history state (such as page IDs)
216 // in the embedder process, at the risk of having incorrect information that 223 // in the embedder process, at the risk of having incorrect information that
217 // can lead to broken back/forward logic in apps. 224 // can lead to broken back/forward logic in apps.
218 // It's also important that this state does not get modified by any logic in 225 // It's also important that this state does not get modified by any logic in
219 // the embedder process. It should only be updated in response to navigation 226 // the embedder process. It should only be updated in response to navigation
220 // events in the guest. No assumptions should be made about how the index 227 // events in the guest. No assumptions should be made about how the index
221 // will change after a navigation (e.g., for back, forward, or go), because 228 // will change after a navigation (e.g., for back, forward, or go), because
222 // the changes are not always obvious. For example, there is a maximum 229 // the changes are not always obvious. For example, there is a maximum
223 // number of entries and earlier ones will automatically be pruned. 230 // number of entries and earlier ones will automatically be pruned.
224 int current_nav_entry_index_; 231 int current_nav_entry_index_;
225 int nav_entry_count_; 232 int nav_entry_count_;
226 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); 233 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin);
227 }; 234 };
228 235
229 } // namespace content 236 } // namespace content
230 237
231 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ 238 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698