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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // the element size. | 67 // the element size. |
68 virtual void GuestSizeChanged(const gfx::Size& new_size) {} | 68 virtual void GuestSizeChanged(const gfx::Size& new_size) {} |
69 | 69 |
70 // Asks the delegate if the given guest can lock the pointer. | 70 // Asks the delegate if the given guest can lock the pointer. |
71 // Invoking the |callback| synchronously is OK. | 71 // Invoking the |callback| synchronously is OK. |
72 virtual void RequestPointerLockPermission( | 72 virtual void RequestPointerLockPermission( |
73 bool user_gesture, | 73 bool user_gesture, |
74 bool last_unlocked_by_target, | 74 bool last_unlocked_by_target, |
75 const base::Callback<void(bool)>& callback) {} | 75 const base::Callback<void(bool)>& callback) {} |
76 | 76 |
77 // Find the given |search_text| in the page. Returns true if the find request | |
78 // is handled by this browser plugin guest delegate. | |
79 virtual bool HandleFindForEmbedder(int request_id, | |
80 const base::string16& search_text, | |
81 const blink::WebFindOptions& options); | |
82 virtual bool HandleStopFindingForEmbedder(StopFindAction action); | |
83 | |
84 // Provides the delegate with an interface with which to communicate with the | 77 // Provides the delegate with an interface with which to communicate with the |
85 // content module. | 78 // content module. |
86 virtual void SetGuestHost(GuestHost* guest_host) {} | 79 virtual void SetGuestHost(GuestHost* guest_host) {} |
87 | 80 |
88 // Sets the position of the context menu for the guest contents. The value | 81 // Sets the position of the context menu for the guest contents. The value |
89 // reported from the guest renderer should be ignored. The reported value | 82 // reported from the guest renderer should be ignored. The reported value |
90 // from the guest renderer is incorrect in situations where BrowserPlugin is | 83 // from the guest renderer is incorrect in situations where BrowserPlugin is |
91 // subject to CSS transforms. | 84 // subject to CSS transforms. |
92 virtual void SetContextMenuPosition(const gfx::Point& position) {} | 85 virtual void SetContextMenuPosition(const gfx::Point& position) {} |
93 | 86 |
94 // TODO(ekaramad): A short workaround to force some types of guests to use | 87 // TODO(ekaramad): A short workaround to force some types of guests to use |
95 // a BrowserPlugin even when we are using cross process frames for guests. It | 88 // a BrowserPlugin even when we are using cross process frames for guests. It |
96 // should be removed after resolving https://crbug.com/642826). | 89 // should be removed after resolving https://crbug.com/642826). |
97 virtual bool CanUseCrossProcessFrames(); | 90 virtual bool CanUseCrossProcessFrames(); |
98 | 91 |
99 // Returns the RenderWidgetHost corresponding to the owner frame. | 92 // Returns the RenderWidgetHost corresponding to the owner frame. |
100 virtual RenderWidgetHost* GetOwnerRenderWidgetHost(); | 93 virtual RenderWidgetHost* GetOwnerRenderWidgetHost(); |
101 | 94 |
102 // The site instance of the owner frame. | 95 // The site instance of the owner frame. |
103 virtual SiteInstance* GetOwnerSiteInstance(); | 96 virtual SiteInstance* GetOwnerSiteInstance(); |
104 | 97 |
105 // Returns true if the corresponding guest is allowed to be embedded inside an | 98 // Returns true if the corresponding guest is allowed to be embedded inside an |
106 // <iframe> which is cross process. | 99 // <iframe> which is cross process. |
107 virtual bool CanBeEmbeddedInsideCrossProcessFrames(); | 100 virtual bool CanBeEmbeddedInsideCrossProcessFrames(); |
108 }; | 101 }; |
109 | 102 |
110 } // namespace content | 103 } // namespace content |
111 | 104 |
112 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 105 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
OLD | NEW |