OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 // BrowserPluginGuestDelegate implementation. | 197 // BrowserPluginGuestDelegate implementation. |
198 virtual void Destroy() OVERRIDE FINAL; | 198 virtual void Destroy() OVERRIDE FINAL; |
199 virtual void DidAttach() OVERRIDE FINAL; | 199 virtual void DidAttach() OVERRIDE FINAL; |
200 virtual int GetGuestInstanceID() const OVERRIDE; | 200 virtual int GetGuestInstanceID() const OVERRIDE; |
201 virtual void RegisterDestructionCallback( | 201 virtual void RegisterDestructionCallback( |
202 const DestructionCallback& callback) OVERRIDE FINAL; | 202 const DestructionCallback& callback) OVERRIDE FINAL; |
203 virtual void WillAttach( | 203 virtual void WillAttach( |
204 content::WebContents* embedder_web_contents, | 204 content::WebContents* embedder_web_contents, |
205 const base::DictionaryValue& extra_params) OVERRIDE FINAL; | 205 const base::DictionaryValue& extra_params) OVERRIDE FINAL; |
206 | 206 |
207 // Dispatches an event |event_name| to the embedder with the |event| fields. | |
208 // Change this function as a public function because WebViewGuest will use it | |
Fady Samuel
2014/06/27 18:46:07
Remove this part of the comment.
Xi Han
2014/07/03 18:55:58
Done.
| |
209 // to dispatch permission request event. | |
210 void DispatchEvent(Event* event); | |
Fady Samuel
2014/06/27 18:46:07
Couple you please rename this to DispatchEventToEm
Xi Han
2014/07/03 18:55:58
Done.
| |
211 | |
207 protected: | 212 protected: |
208 GuestViewBase(content::BrowserContext* browser_context, | 213 GuestViewBase(content::BrowserContext* browser_context, |
209 int guest_instance_id); | 214 int guest_instance_id); |
210 | 215 |
211 virtual ~GuestViewBase(); | 216 virtual ~GuestViewBase(); |
212 | 217 |
213 // Dispatches an event |event_name| to the embedder with the |event| fields. | |
214 void DispatchEvent(Event* event); | |
215 | |
216 private: | 218 private: |
217 class EmbedderWebContentsObserver; | 219 class EmbedderWebContentsObserver; |
218 | 220 |
219 void SendQueuedEvents(); | 221 void SendQueuedEvents(); |
220 | 222 |
221 void CompleteCreateWebContents(const std::string& embedder_extension_id, | 223 void CompleteCreateWebContents(const std::string& embedder_extension_id, |
222 int embedder_render_process_id, | 224 int embedder_render_process_id, |
223 const WebContentsCreatedCallback& callback, | 225 const WebContentsCreatedCallback& callback, |
224 content::WebContents* guest_web_contents); | 226 content::WebContents* guest_web_contents); |
225 | 227 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; | 267 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; |
266 | 268 |
267 // This is used to ensure pending tasks will not fire after this object is | 269 // This is used to ensure pending tasks will not fire after this object is |
268 // destroyed. | 270 // destroyed. |
269 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 271 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
270 | 272 |
271 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 273 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
272 }; | 274 }; |
273 | 275 |
274 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 276 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
OLD | NEW |