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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_
8 #include "base/callback_forward.h"
9 #include "base/process/kill.h"
10 #include "content/common/content_export.h"
13 class DictionaryValue;
24 // Objects implement this interface to get notified about changes in the guest
25 // WebContents and to provide necessary functionality.
26 class CONTENT_EXPORT BrowserPluginGuestDelegate {
28 virtual ~BrowserPluginGuestDelegate() {}
30 // Notification that the embedder will begin attachment. This is called
31 // prior to resuming resource loads.
32 virtual void WillAttach(content::WebContents* embedder_web_contents,
33 const base::DictionaryValue& extra_params) {}
35 // Notification that the embedder has completed attachment.
36 virtual void DidAttach() {}
38 // Notifies that the content size of the guest has changed in autosize mode.
39 virtual void SizeChanged(const gfx::Size& old_size,
40 const gfx::Size& new_size) {}
42 // Asks the delegate if the given guest can lock the pointer.
43 // Invoking the |callback| synchronously is OK.
44 virtual void RequestPointerLockPermission(
46 bool last_unlocked_by_target,
47 const base::Callback<void(bool)>& callback) {}
49 // Requests that the delegate destroy itself along with its associated
51 virtual void Destroy() {}
53 // Registers a |callback| with the delegate that the delegate would call when
54 // it is about to be destroyed.
55 typedef base::Callback<void()> DestructionCallback;
56 virtual void RegisterDestructionCallback(
57 const DestructionCallback& callback) {}
60 } // namespace content
62 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_