| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PUBLIC_BROWSER_GUEST_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_GUEST_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_GUEST_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_GUEST_HOST_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/geometry/size.h" | 8 #include "ui/gfx/geometry/size.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 class WebContents; |
| 13 |
| 12 // A GuestHost is the content API for a guest WebContents. | 14 // A GuestHost is the content API for a guest WebContents. |
| 13 // Guests are top-level frames that can be embedded within other pages. | 15 // Guests are top-level frames that can be embedded within other pages. |
| 14 // The content module manages routing of input events and compositing, but all | 16 // The content module manages routing of input events and compositing, but all |
| 15 // other operations are managed outside of content. To limit exposure of | 17 // other operations are managed outside of content. To limit exposure of |
| 16 // implementation details within content, content embedders must use this | 18 // implementation details within content, content embedders must use this |
| 17 // interface for loading, sizing, and cleanup of guests. | 19 // interface for loading, sizing, and cleanup of guests. |
| 18 // | 20 // |
| 19 // This class currently only serves as a base class for BrowserPluginGuest, and | 21 // This class currently only serves as a base class for BrowserPluginGuest, and |
| 20 // its API can only be accessed by a BrowserPluginGuestDelegate. | 22 // its API can only be accessed by a BrowserPluginGuestDelegate. |
| 21 class GuestHost { | 23 class GuestHost { |
| 22 public: | 24 public: |
| 23 // Loads a URL using the specified |load_params| and returns a routing ID for | 25 // Loads a URL using the specified |load_params| and returns a routing ID for |
| 24 // a proxy for the guest. | 26 // a proxy for the guest. |
| 25 virtual int LoadURLWithParams( | 27 virtual int LoadURLWithParams( |
| 26 const NavigationController::LoadURLParams& load_params) = 0; | 28 const NavigationController::LoadURLParams& load_params) = 0; |
| 27 | 29 |
| 28 // Called when the GuestHost's size changes due to auto resize. | 30 // Called when the GuestHost's size changes due to auto resize. |
| 29 virtual void GuestResizeDueToAutoResize(const gfx::Size& new_size) = 0; | 31 virtual void GuestResizeDueToAutoResize(const gfx::Size& new_size) = 0; |
| 30 | 32 |
| 31 // Sets the size of the guest WebContents. | 33 // Sets the size of the guest WebContents. |
| 32 virtual void SizeContents(const gfx::Size& new_size) = 0; | 34 virtual void SizeContents(const gfx::Size& new_size) = 0; |
| 33 | 35 |
| 34 // Called when the GuestHost is about to be destroyed. | 36 // Called when the GuestHost is about to be destroyed. |
| 35 virtual void WillDestroy() = 0; | 37 virtual void WillDestroy() = 0; |
| 38 |
| 39 // Registers the |process_id| and |routing_id| of the embedder frame for this |
| 40 // guest and returns the WebContents associated with the frame. |
| 41 virtual WebContents* RegisterEmbedderID(int process_id, int routing_id) = 0; |
| 36 }; | 42 }; |
| 37 | 43 |
| 38 } // namespace content | 44 } // namespace content |
| 39 | 45 |
| 40 #endif // CONTENT_PUBLIC_BROWSER_GUEST_HOST_H_ | 46 #endif // CONTENT_PUBLIC_BROWSER_GUEST_HOST_H_ |
| OLD | NEW |