Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/process/kill.h" | 9 #include "base/process/kill.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 // Notification that the embedder will begin attachment. This is called | 29 // Notification that the embedder will begin attachment. This is called |
| 30 // prior to resuming resource loads. |element_instance_id| uniquely identifies | 30 // prior to resuming resource loads. |element_instance_id| uniquely identifies |
| 31 // the element that will serve as a container for the guest. | 31 // the element that will serve as a container for the guest. |
| 32 virtual void WillAttach(content::WebContents* embedder_web_contents, | 32 virtual void WillAttach(content::WebContents* embedder_web_contents, |
| 33 int element_instance_id, | 33 int element_instance_id, |
| 34 bool is_full_page_plugin) {} | 34 bool is_full_page_plugin) {} |
| 35 | 35 |
| 36 virtual WebContents* CreateNewGuestWindow( | 36 virtual WebContents* CreateNewGuestWindow( |
| 37 const WebContents::CreateParams& create_params); | 37 const WebContents::CreateParams& create_params); |
| 38 | 38 |
| 39 // Asks the delegate whether this guest can run while detached from a | |
| 40 // container. | |
| 41 virtual bool CanRunInDetachedState() const; | |
|
lazyboy
2014/12/04 16:51:13
Explain "detached" a bit more here.
Fady Samuel
2014/12/04 20:54:44
Done.
| |
| 42 | |
| 39 // Notification that the embedder has completed attachment. The | 43 // Notification that the embedder has completed attachment. The |
| 40 // |guest_proxy_routing_id| is the routing ID for the RenderView in the | 44 // |guest_proxy_routing_id| is the routing ID for the RenderView in the |
| 41 // embedder that will serve as a contentWindow proxy for the guest. | 45 // embedder that will serve as a contentWindow proxy for the guest. |
| 42 virtual void DidAttach(int guest_proxy_routing_id) {} | 46 virtual void DidAttach(int guest_proxy_routing_id) {} |
| 43 | 47 |
| 44 // Notification that the guest has detached from its container. | 48 // Notification that the guest has detached from its container. |
| 45 virtual void DidDetach() {} | 49 virtual void DidDetach() {} |
| 46 | 50 |
| 47 // Notification that the BrowserPlugin has resized. | 51 // Notification that the BrowserPlugin has resized. |
| 48 virtual void ElementSizeChanged(const gfx::Size& old_size, | 52 virtual void ElementSizeChanged(const gfx::Size& old_size, |
| 49 const gfx::Size& new_size) {} | 53 const gfx::Size& new_size) {} |
| 50 | 54 |
| 55 // Returns the WebContents that currently owns this guest. | |
| 56 virtual WebContents* GetOwnerWebContents() const; | |
| 57 | |
| 51 // Notifies that the content size of the guest has changed. | 58 // Notifies that the content size of the guest has changed. |
| 52 // Note: In autosize mode, it si possible that the guest size may not match | 59 // Note: In autosize mode, it si possible that the guest size may not match |
| 53 // the element size. | 60 // the element size. |
| 54 virtual void GuestSizeChanged(const gfx::Size& old_size, | 61 virtual void GuestSizeChanged(const gfx::Size& old_size, |
| 55 const gfx::Size& new_size) {} | 62 const gfx::Size& new_size) {} |
| 56 | 63 |
| 57 // Asks the delegate if the given guest can lock the pointer. | 64 // Asks the delegate if the given guest can lock the pointer. |
| 58 // Invoking the |callback| synchronously is OK. | 65 // Invoking the |callback| synchronously is OK. |
| 59 virtual void RequestPointerLockPermission( | 66 virtual void RequestPointerLockPermission( |
| 60 bool user_gesture, | 67 bool user_gesture, |
| 61 bool last_unlocked_by_target, | 68 bool last_unlocked_by_target, |
| 62 const base::Callback<void(bool)>& callback) {} | 69 const base::Callback<void(bool)>& callback) {} |
| 63 | 70 |
| 64 // Registers a |callback| with the delegate that the delegate would call when | 71 // Registers a |callback| with the delegate that the delegate would call when |
| 65 // it is about to be destroyed. | 72 // it is about to be destroyed. |
| 66 typedef base::Callback<void()> DestructionCallback; | 73 typedef base::Callback<void()> DestructionCallback; |
| 67 virtual void RegisterDestructionCallback( | 74 virtual void RegisterDestructionCallback( |
| 68 const DestructionCallback& callback) {} | 75 const DestructionCallback& callback) {} |
| 69 | 76 |
| 70 // Find the given |search_text| in the page. Returns true if the find request | 77 // Find the given |search_text| in the page. Returns true if the find request |
| 71 // is handled by this browser plugin guest delegate. | 78 // is handled by this browser plugin guest delegate. |
| 72 virtual bool Find(int request_id, | 79 virtual bool Find(int request_id, |
| 73 const base::string16& search_text, | 80 const base::string16& search_text, |
| 74 const blink::WebFindOptions& options); | 81 const blink::WebFindOptions& options); |
| 75 }; | 82 }; |
| 76 | 83 |
| 77 } // namespace content | 84 } // namespace content |
| 78 | 85 |
| 79 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 86 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
| OLD | NEW |