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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 public: | 28 public: |
29 // Called only by tests to clean up before we blow away the MockRenderProcess. | 29 // Called only by tests to clean up before we blow away the MockRenderProcess. |
30 void Cleanup(); | 30 void Cleanup(); |
31 | 31 |
32 // Get the src attribute value of the BrowserPlugin instance if the guest | 32 // Get the src attribute value of the BrowserPlugin instance if the guest |
33 // has not crashed. | 33 // has not crashed. |
34 std::string GetSrcAttribute() const; | 34 std::string GetSrcAttribute() const; |
35 // Set the src attribute value of the BrowserPlugin instance and reset | 35 // Set the src attribute value of the BrowserPlugin instance and reset |
36 // the guest_crashed_ flag. | 36 // the guest_crashed_ flag. |
37 void SetSrcAttribute(const std::string& src); | 37 void SetSrcAttribute(const std::string& src); |
| 38 // Returns Chrome's process ID for the current guest. |
| 39 int process_id() const { return process_id_; } |
38 | 40 |
39 // Inform the BrowserPlugin to update its backing store with the pixels in | 41 // Inform the BrowserPlugin to update its backing store with the pixels in |
40 // its damage buffer. | 42 // its damage buffer. |
41 void UpdateRect(int message_id, | 43 void UpdateRect(int message_id, |
42 const BrowserPluginMsg_UpdateRect_Params& params); | 44 const BrowserPluginMsg_UpdateRect_Params& params); |
43 // Inform the BrowserPlugin that its guest has crashed. | 45 // Inform the BrowserPlugin that its guest has crashed. |
44 void GuestCrashed(); | 46 void GuestCrashed(); |
45 // Informs the BrowserPlugin that the guest has navigated to a new URL. | 47 // Informs the BrowserPlugin that the guest has navigated to a new URL. |
46 void DidNavigate(const GURL& url); | 48 void DidNavigate(const GURL& url, int process_id); |
47 // Tells the BrowserPlugin to advance the focus to the next (or previous) | 49 // Tells the BrowserPlugin to advance the focus to the next (or previous) |
48 // element. | 50 // element. |
49 void AdvanceFocus(bool reverse); | 51 void AdvanceFocus(bool reverse); |
50 | 52 |
51 // Indicates whether there are any Javascript listeners attached to a | 53 // Indicates whether there are any Javascript listeners attached to a |
52 // provided event_name. | 54 // provided event_name. |
53 bool HasListeners(const std::string& event_name); | 55 bool HasListeners(const std::string& event_name); |
54 // Add a custom event listener to this BrowserPlugin instance. | 56 // Add a custom event listener to this BrowserPlugin instance. |
55 bool AddEventListener(const std::string& event_name, | 57 bool AddEventListener(const std::string& event_name, |
56 v8::Local<v8::Function> function); | 58 v8::Local<v8::Function> function); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 TransportDIB* damage_buffer_; | 143 TransportDIB* damage_buffer_; |
142 gfx::Rect plugin_rect_; | 144 gfx::Rect plugin_rect_; |
143 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. | 145 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. |
144 SkBitmap* sad_guest_; | 146 SkBitmap* sad_guest_; |
145 bool guest_crashed_; | 147 bool guest_crashed_; |
146 bool resize_pending_; | 148 bool resize_pending_; |
147 // True if we have ever sent a NavigateGuest message to the embedder. | 149 // True if we have ever sent a NavigateGuest message to the embedder. |
148 bool navigate_src_sent_; | 150 bool navigate_src_sent_; |
149 int64 parent_frame_; | 151 int64 parent_frame_; |
150 std::string src_; | 152 std::string src_; |
| 153 int process_id_; |
151 typedef std::vector<v8::Persistent<v8::Function> > EventListeners; | 154 typedef std::vector<v8::Persistent<v8::Function> > EventListeners; |
152 typedef std::map<std::string, EventListeners> EventListenerMap; | 155 typedef std::map<std::string, EventListeners> EventListenerMap; |
153 EventListenerMap event_listener_map_; | 156 EventListenerMap event_listener_map_; |
154 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
155 base::SharedMemory shared_memory_; | 158 base::SharedMemory shared_memory_; |
156 #endif | 159 #endif |
157 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 160 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
158 }; | 161 }; |
159 | 162 |
160 } // namespace content | 163 } // namespace content |
161 | 164 |
162 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 165 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |