| 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 EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 6 #define EXTENSIONS_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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 void SetOpener(GuestViewBase* opener); | 228 void SetOpener(GuestViewBase* opener); |
| 229 | 229 |
| 230 // RenderProcessHostObserver implementation | 230 // RenderProcessHostObserver implementation |
| 231 virtual void RenderProcessExited(content::RenderProcessHost* host, | 231 virtual void RenderProcessExited(content::RenderProcessHost* host, |
| 232 base::ProcessHandle handle, | 232 base::ProcessHandle handle, |
| 233 base::TerminationStatus status, | 233 base::TerminationStatus status, |
| 234 int exit_code) OVERRIDE; | 234 int exit_code) OVERRIDE; |
| 235 | 235 |
| 236 // BrowserPluginGuestDelegate implementation. | 236 // BrowserPluginGuestDelegate implementation. |
| 237 virtual void Destroy() OVERRIDE FINAL; | 237 virtual void Destroy() OVERRIDE FINAL; |
| 238 virtual void DidAttach() OVERRIDE FINAL; | 238 virtual void DidAttach(int guest_proxy_routing_id) OVERRIDE FINAL; |
| 239 virtual void ElementSizeChanged(const gfx::Size& old_size, | 239 virtual void ElementSizeChanged(const gfx::Size& old_size, |
| 240 const gfx::Size& new_size) OVERRIDE FINAL; | 240 const gfx::Size& new_size) OVERRIDE FINAL; |
| 241 virtual void GuestSizeChanged(const gfx::Size& old_size, | 241 virtual void GuestSizeChanged(const gfx::Size& old_size, |
| 242 const gfx::Size& new_size) OVERRIDE FINAL; | 242 const gfx::Size& new_size) OVERRIDE FINAL; |
| 243 virtual void RegisterDestructionCallback( | 243 virtual void RegisterDestructionCallback( |
| 244 const DestructionCallback& callback) OVERRIDE FINAL; | 244 const DestructionCallback& callback) OVERRIDE FINAL; |
| 245 virtual void WillAttach( | 245 virtual void WillAttach( |
| 246 content::WebContents* embedder_web_contents) OVERRIDE FINAL; | 246 content::WebContents* embedder_web_contents, |
| 247 int browser_plugin_instance_id) OVERRIDE FINAL; |
| 247 | 248 |
| 248 // Dispatches an event |event_name| to the embedder with the |event| fields. | 249 // Dispatches an event |event_name| to the embedder with the |event| fields. |
| 249 void DispatchEventToEmbedder(Event* event); | 250 void DispatchEventToEmbedder(Event* event); |
| 250 | 251 |
| 251 protected: | 252 protected: |
| 252 GuestViewBase(content::BrowserContext* browser_context, | 253 GuestViewBase(content::BrowserContext* browser_context, |
| 253 int guest_instance_id); | 254 int guest_instance_id); |
| 254 | 255 |
| 255 virtual ~GuestViewBase(); | 256 virtual ~GuestViewBase(); |
| 256 | 257 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 281 const content::FileChooserParams& params) OVERRIDE; | 282 const content::FileChooserParams& params) OVERRIDE; |
| 282 virtual bool ShouldFocusPageAfterCrash() OVERRIDE FINAL; | 283 virtual bool ShouldFocusPageAfterCrash() OVERRIDE FINAL; |
| 283 virtual bool PreHandleGestureEvent( | 284 virtual bool PreHandleGestureEvent( |
| 284 content::WebContents* source, | 285 content::WebContents* source, |
| 285 const blink::WebGestureEvent& event) OVERRIDE FINAL; | 286 const blink::WebGestureEvent& event) OVERRIDE FINAL; |
| 286 | 287 |
| 287 content::WebContents* embedder_web_contents_; | 288 content::WebContents* embedder_web_contents_; |
| 288 std::string embedder_extension_id_; | 289 std::string embedder_extension_id_; |
| 289 int embedder_render_process_id_; | 290 int embedder_render_process_id_; |
| 290 content::BrowserContext* browser_context_; | 291 content::BrowserContext* browser_context_; |
| 292 |
| 291 // |guest_instance_id_| is a profile-wide unique identifier for a guest | 293 // |guest_instance_id_| is a profile-wide unique identifier for a guest |
| 292 // WebContents. | 294 // WebContents. |
| 293 const int guest_instance_id_; | 295 const int guest_instance_id_; |
| 296 |
| 294 // |view_instance_id_| is an identifier that's unique within a particular | 297 // |view_instance_id_| is an identifier that's unique within a particular |
| 295 // embedder RenderViewHost for a particular <*view> instance. | 298 // embedder RenderViewHost for a particular <*view> instance. |
| 296 int view_instance_id_; | 299 int view_instance_id_; |
| 297 | 300 |
| 301 // |element_instance_id_| is an identififer that's unique to a particular |
| 302 // GuestViewContainer element. |
| 303 int element_instance_id_; |
| 304 |
| 298 bool initialized_; | 305 bool initialized_; |
| 299 | 306 |
| 300 // This is a queue of Events that are destined to be sent to the embedder once | 307 // This is a queue of Events that are destined to be sent to the embedder once |
| 301 // the guest is attached to a particular embedder. | 308 // the guest is attached to a particular embedder. |
| 302 std::deque<linked_ptr<Event> > pending_events_; | 309 std::deque<linked_ptr<Event> > pending_events_; |
| 303 | 310 |
| 304 // The opener guest view. | 311 // The opener guest view. |
| 305 base::WeakPtr<GuestViewBase> opener_; | 312 base::WeakPtr<GuestViewBase> opener_; |
| 306 | 313 |
| 307 DestructionCallback destruction_callback_; | 314 DestructionCallback destruction_callback_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 333 // This is used to ensure pending tasks will not fire after this object is | 340 // This is used to ensure pending tasks will not fire after this object is |
| 334 // destroyed. | 341 // destroyed. |
| 335 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 342 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
| 336 | 343 |
| 337 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 344 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
| 338 }; | 345 }; |
| 339 | 346 |
| 340 } // namespace extensions | 347 } // namespace extensions |
| 341 | 348 |
| 342 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 349 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| OLD | NEW |