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" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Size; | 13 class Size; |
| 14 } // namespace gfx | 14 } // namespace gfx |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 class WebContents; | 18 class WebContents; |
| 19 | 19 |
| 20 // Objects implement this interface to get notified about changes in the guest | 20 // Objects implement this interface to get notified about changes in the guest |
| 21 // WebContents and to provide necessary functionality. | 21 // WebContents and to provide necessary functionality. |
| 22 class CONTENT_EXPORT BrowserPluginGuestDelegate { | 22 class CONTENT_EXPORT BrowserPluginGuestDelegate { |
| 23 public: | 23 public: |
| 24 virtual ~BrowserPluginGuestDelegate() {} | 24 virtual ~BrowserPluginGuestDelegate() {} |
| 25 | 25 |
| 26 // Notification that the embedder has completed attachment. | 26 // Notification that the embedder has completed attachment. |
| 27 virtual void DidAttach() {} | 27 virtual void DidAttach() {} |
| 28 | 28 |
| 29 // Informs the delegate that the embedder has been destroyed. | |
| 30 virtual void EmbedderDestroyed() {} | |
| 31 | |
| 32 // Requests setting the zoom level to the provided |zoom_level|. | 29 // Requests setting the zoom level to the provided |zoom_level|. |
| 33 virtual void SetZoom(double zoom_factor) {} | 30 virtual void SetZoom(double zoom_factor) {} |
| 34 | 31 |
| 35 virtual bool IsDragAndDropEnabled(); | 32 virtual bool IsDragAndDropEnabled(); |
| 36 | 33 |
| 37 // 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. |
| 38 virtual void SizeChanged(const gfx::Size& old_size, | 35 virtual void SizeChanged(const gfx::Size& old_size, |
| 39 const gfx::Size& new_size) {} | 36 const gfx::Size& new_size) {} |
| 40 | 37 |
| 41 // Asks the delegate if the given guest can lock the pointer. | 38 // Asks the delegate if the given guest can lock the pointer. |
| 42 // Invoking the |callback| synchronously is OK. | 39 // Invoking the |callback| synchronously is OK. |
| 43 virtual void RequestPointerLockPermission( | 40 virtual void RequestPointerLockPermission( |
| 44 bool user_gesture, | 41 bool user_gesture, |
| 45 bool last_unlocked_by_target, | 42 bool last_unlocked_by_target, |
| 46 const base::Callback<void(bool)>& callback) {} | 43 const base::Callback<void(bool)>& callback) {} |
| 47 | 44 |
| 48 // Request navigating the guest to the provided |src| URL. | 45 // Request navigating the guest to the provided |src| URL. |
| 49 virtual void NavigateGuest(const std::string& src) {} | 46 virtual void NavigateGuest(const std::string& src) {} |
| 50 | 47 |
| 51 // Requests that the delegate destroy itself along with its associated | 48 // Requests that the delegate destroy itself along with its associated |
| 52 // WebContents. | 49 // WebContents. |
| 53 virtual void Destroy() {} | 50 virtual void Destroy() {} |
| 54 | 51 |
| 55 // Registers a |callback| with the delegate that the delegate would call when | 52 // Registers a |callback| with the delegate that the delegate would call when |
| 56 // it is about to be destroyed. | 53 // it is about to be destroyed. |
| 57 typedef base::Callback<void(WebContents*)> DestructionCallback; | 54 typedef base::Callback<void()>DestructionCallback; |
|
lazyboy
2014/05/29 19:13:58
nit: space before DestructionCallback.
Fady Samuel
2014/05/29 21:21:12
Done.
| |
| 58 virtual void RegisterDestructionCallback( | 55 virtual void RegisterDestructionCallback( |
| 59 const DestructionCallback& callback) {} | 56 const DestructionCallback& callback) {} |
| 60 }; | 57 }; |
| 61 | 58 |
| 62 } // namespace content | 59 } // namespace content |
| 63 | 60 |
| 64 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 61 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
| OLD | NEW |