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 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class WebContents; | 22 class WebContents; |
23 | 23 |
24 // Objects implement this interface to get notified about changes in the guest | 24 // Objects implement this interface to get notified about changes in the guest |
25 // WebContents and to provide necessary functionality. | 25 // WebContents and to provide necessary functionality. |
26 class CONTENT_EXPORT BrowserPluginGuestDelegate { | 26 class CONTENT_EXPORT BrowserPluginGuestDelegate { |
27 public: | 27 public: |
28 virtual ~BrowserPluginGuestDelegate() {} | 28 virtual ~BrowserPluginGuestDelegate() {} |
29 | 29 |
30 // Notification that the embedder has completed attachment. | 30 // Notification that the embedder has completed attachment. |
31 virtual void DidAttach(const base::DictionaryValue& extra_params) {} | 31 virtual void DidAttach(content::WebContents* embedder_web_contents, |
| 32 const base::DictionaryValue& extra_params) {} |
32 | 33 |
33 // Notifies that the content size of the guest has changed in autosize mode. | 34 // Notifies that the content size of the guest has changed in autosize mode. |
34 virtual void SizeChanged(const gfx::Size& old_size, | 35 virtual void SizeChanged(const gfx::Size& old_size, |
35 const gfx::Size& new_size) {} | 36 const gfx::Size& new_size) {} |
36 | 37 |
37 // Asks the delegate if the given guest can lock the pointer. | 38 // Asks the delegate if the given guest can lock the pointer. |
38 // Invoking the |callback| synchronously is OK. | 39 // Invoking the |callback| synchronously is OK. |
39 virtual void RequestPointerLockPermission( | 40 virtual void RequestPointerLockPermission( |
40 bool user_gesture, | 41 bool user_gesture, |
41 bool last_unlocked_by_target, | 42 bool last_unlocked_by_target, |
42 const base::Callback<void(bool)>& callback) {} | 43 const base::Callback<void(bool)>& callback) {} |
43 | 44 |
44 // Requests that the delegate destroy itself along with its associated | 45 // Requests that the delegate destroy itself along with its associated |
45 // WebContents. | 46 // WebContents. |
46 virtual void Destroy() {} | 47 virtual void Destroy() {} |
47 | 48 |
48 // Registers a |callback| with the delegate that the delegate would call when | 49 // Registers a |callback| with the delegate that the delegate would call when |
49 // it is about to be destroyed. | 50 // it is about to be destroyed. |
50 typedef base::Callback<void()> DestructionCallback; | 51 typedef base::Callback<void()> DestructionCallback; |
51 virtual void RegisterDestructionCallback( | 52 virtual void RegisterDestructionCallback( |
52 const DestructionCallback& callback) {} | 53 const DestructionCallback& callback) {} |
53 }; | 54 }; |
54 | 55 |
55 } // namespace content | 56 } // namespace content |
56 | 57 |
57 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 58 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
OLD | NEW |