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 #include "content/public/browser/guest_sizer.h" | |
12 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
13 | 12 |
14 namespace base { | 13 namespace base { |
15 class DictionaryValue; | 14 class DictionaryValue; |
16 } // namespace base | 15 } // namespace base |
17 | 16 |
18 namespace gfx { | 17 namespace gfx { |
19 class Size; | 18 class Size; |
20 } // namespace gfx | 19 } // namespace gfx |
21 | 20 |
22 namespace content { | 21 namespace content { |
23 | 22 |
| 23 class GuestHost; |
| 24 |
24 // Objects implement this interface to get notified about changes in the guest | 25 // Objects implement this interface to get notified about changes in the guest |
25 // WebContents and to provide necessary functionality. | 26 // WebContents and to provide necessary functionality. |
26 class CONTENT_EXPORT BrowserPluginGuestDelegate { | 27 class CONTENT_EXPORT BrowserPluginGuestDelegate { |
27 public: | 28 public: |
28 virtual ~BrowserPluginGuestDelegate() {} | 29 virtual ~BrowserPluginGuestDelegate() {} |
29 | 30 |
30 // Notification that the embedder will begin attachment. This is called | 31 // Notification that the embedder will begin attachment. This is called |
31 // prior to resuming resource loads. |element_instance_id| uniquely identifies | 32 // prior to resuming resource loads. |element_instance_id| uniquely identifies |
32 // the element that will serve as a container for the guest. | 33 // the element that will serve as a container for the guest. |
33 virtual void WillAttach(content::WebContents* embedder_web_contents, | 34 virtual void WillAttach(content::WebContents* embedder_web_contents, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // the element size. | 66 // the element size. |
66 virtual void GuestSizeChanged(const gfx::Size& new_size) {} | 67 virtual void GuestSizeChanged(const gfx::Size& new_size) {} |
67 | 68 |
68 // Asks the delegate if the given guest can lock the pointer. | 69 // Asks the delegate if the given guest can lock the pointer. |
69 // Invoking the |callback| synchronously is OK. | 70 // Invoking the |callback| synchronously is OK. |
70 virtual void RequestPointerLockPermission( | 71 virtual void RequestPointerLockPermission( |
71 bool user_gesture, | 72 bool user_gesture, |
72 bool last_unlocked_by_target, | 73 bool last_unlocked_by_target, |
73 const base::Callback<void(bool)>& callback) {} | 74 const base::Callback<void(bool)>& callback) {} |
74 | 75 |
75 // Registers a |callback| with the delegate that the delegate would call when | |
76 // it is about to be destroyed. | |
77 typedef base::Callback<void()> DestructionCallback; | |
78 virtual void RegisterDestructionCallback( | |
79 const DestructionCallback& callback) {} | |
80 | |
81 // Find the given |search_text| in the page. Returns true if the find request | 76 // Find the given |search_text| in the page. Returns true if the find request |
82 // is handled by this browser plugin guest delegate. | 77 // is handled by this browser plugin guest delegate. |
83 virtual bool Find(int request_id, | 78 virtual bool Find(int request_id, |
84 const base::string16& search_text, | 79 const base::string16& search_text, |
85 const blink::WebFindOptions& options); | 80 const blink::WebFindOptions& options); |
86 virtual bool StopFinding(StopFindAction action); | 81 virtual bool StopFinding(StopFindAction action); |
87 | 82 |
88 // Provides the delegate with an interface with which to size the guest. | 83 // Provides the delegate with an interface with which to communicate with the |
89 virtual void SetGuestSizer(GuestSizer* guest_sizer) {} | 84 // content module. |
| 85 virtual void SetGuestHost(GuestHost* guest_host) {} |
90 }; | 86 }; |
91 | 87 |
92 } // namespace content | 88 } // namespace content |
93 | 89 |
94 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 90 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
OLD | NEW |