| 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 Destroy(); | 228 void Destroy(); |
| 229 | 229 |
| 230 // Saves the attach state of the custom element hosting this GuestView. | 230 // Saves the attach state of the custom element hosting this GuestView. |
| 231 void SetAttachParams(const base::DictionaryValue& params); | 231 void SetAttachParams(const base::DictionaryValue& params); |
| 232 void SetOpener(GuestViewBase* opener); | 232 void SetOpener(GuestViewBase* opener); |
| 233 | 233 |
| 234 // RenderProcessHostObserver implementation | 234 // RenderProcessHostObserver implementation |
| 235 virtual void RenderProcessExited(content::RenderProcessHost* host, | 235 virtual void RenderProcessExited(content::RenderProcessHost* host, |
| 236 base::ProcessHandle handle, | 236 base::ProcessHandle handle, |
| 237 base::TerminationStatus status, | 237 base::TerminationStatus status, |
| 238 int exit_code) OVERRIDE; | 238 int exit_code) override; |
| 239 | 239 |
| 240 // BrowserPluginGuestDelegate implementation. | 240 // BrowserPluginGuestDelegate implementation. |
| 241 virtual void DidAttach(int guest_proxy_routing_id) OVERRIDE FINAL; | 241 virtual void DidAttach(int guest_proxy_routing_id) override final; |
| 242 virtual void ElementSizeChanged(const gfx::Size& old_size, | 242 virtual void ElementSizeChanged(const gfx::Size& old_size, |
| 243 const gfx::Size& new_size) OVERRIDE FINAL; | 243 const gfx::Size& new_size) override final; |
| 244 virtual void GuestSizeChanged(const gfx::Size& old_size, | 244 virtual void GuestSizeChanged(const gfx::Size& old_size, |
| 245 const gfx::Size& new_size) OVERRIDE FINAL; | 245 const gfx::Size& new_size) override final; |
| 246 virtual void RegisterDestructionCallback( | 246 virtual void RegisterDestructionCallback( |
| 247 const DestructionCallback& callback) OVERRIDE FINAL; | 247 const DestructionCallback& callback) override final; |
| 248 virtual void WillAttach( | 248 virtual void WillAttach( |
| 249 content::WebContents* embedder_web_contents, | 249 content::WebContents* embedder_web_contents, |
| 250 int browser_plugin_instance_id) OVERRIDE FINAL; | 250 int browser_plugin_instance_id) override final; |
| 251 | 251 |
| 252 // Dispatches an event |event_name| to the embedder with the |event| fields. | 252 // Dispatches an event |event_name| to the embedder with the |event| fields. |
| 253 void DispatchEventToEmbedder(Event* event); | 253 void DispatchEventToEmbedder(Event* event); |
| 254 | 254 |
| 255 protected: | 255 protected: |
| 256 GuestViewBase(content::BrowserContext* browser_context, | 256 GuestViewBase(content::BrowserContext* browser_context, |
| 257 int guest_instance_id); | 257 int guest_instance_id); |
| 258 | 258 |
| 259 virtual ~GuestViewBase(); | 259 virtual ~GuestViewBase(); |
| 260 | 260 |
| 261 private: | 261 private: |
| 262 class EmbedderWebContentsObserver; | 262 class EmbedderWebContentsObserver; |
| 263 | 263 |
| 264 void SendQueuedEvents(); | 264 void SendQueuedEvents(); |
| 265 | 265 |
| 266 void CompleteInit(const std::string& embedder_extension_id, | 266 void CompleteInit(const std::string& embedder_extension_id, |
| 267 int embedder_render_process_id, | 267 int embedder_render_process_id, |
| 268 const WebContentsCreatedCallback& callback, | 268 const WebContentsCreatedCallback& callback, |
| 269 content::WebContents* guest_web_contents); | 269 content::WebContents* guest_web_contents); |
| 270 | 270 |
| 271 static void RegisterGuestViewTypes(); | 271 static void RegisterGuestViewTypes(); |
| 272 | 272 |
| 273 // WebContentsObserver implementation. | 273 // WebContentsObserver implementation. |
| 274 virtual void DidStopLoading( | 274 virtual void DidStopLoading( |
| 275 content::RenderViewHost* render_view_host) OVERRIDE FINAL; | 275 content::RenderViewHost* render_view_host) override final; |
| 276 virtual void RenderViewReady() OVERRIDE FINAL; | 276 virtual void RenderViewReady() override final; |
| 277 virtual void WebContentsDestroyed() OVERRIDE FINAL; | 277 virtual void WebContentsDestroyed() override final; |
| 278 | 278 |
| 279 // WebContentsDelegate implementation. | 279 // WebContentsDelegate implementation. |
| 280 virtual void ActivateContents(content::WebContents* contents) OVERRIDE FINAL; | 280 virtual void ActivateContents(content::WebContents* contents) override final; |
| 281 virtual void DeactivateContents( | 281 virtual void DeactivateContents( |
| 282 content::WebContents* contents) OVERRIDE FINAL; | 282 content::WebContents* contents) override final; |
| 283 virtual void RunFileChooser( | 283 virtual void RunFileChooser( |
| 284 content::WebContents* web_contents, | 284 content::WebContents* web_contents, |
| 285 const content::FileChooserParams& params) OVERRIDE; | 285 const content::FileChooserParams& params) override; |
| 286 virtual bool ShouldFocusPageAfterCrash() OVERRIDE FINAL; | 286 virtual bool ShouldFocusPageAfterCrash() override final; |
| 287 virtual bool PreHandleGestureEvent( | 287 virtual bool PreHandleGestureEvent( |
| 288 content::WebContents* source, | 288 content::WebContents* source, |
| 289 const blink::WebGestureEvent& event) OVERRIDE FINAL; | 289 const blink::WebGestureEvent& event) override final; |
| 290 | 290 |
| 291 content::WebContents* embedder_web_contents_; | 291 content::WebContents* embedder_web_contents_; |
| 292 std::string embedder_extension_id_; | 292 std::string embedder_extension_id_; |
| 293 int embedder_render_process_id_; | 293 int embedder_render_process_id_; |
| 294 content::BrowserContext* browser_context_; | 294 content::BrowserContext* browser_context_; |
| 295 | 295 |
| 296 // |guest_instance_id_| is a profile-wide unique identifier for a guest | 296 // |guest_instance_id_| is a profile-wide unique identifier for a guest |
| 297 // WebContents. | 297 // WebContents. |
| 298 const int guest_instance_id_; | 298 const int guest_instance_id_; |
| 299 | 299 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 // This is used to ensure pending tasks will not fire after this object is | 343 // This is used to ensure pending tasks will not fire after this object is |
| 344 // destroyed. | 344 // destroyed. |
| 345 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 345 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
| 346 | 346 |
| 347 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 347 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
| 348 }; | 348 }; |
| 349 | 349 |
| 350 } // namespace extensions | 350 } // namespace extensions |
| 351 | 351 |
| 352 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 352 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| OLD | NEW |