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 "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/public/common/browser_plugin_permission_type.h" | 13 #include "content/public/common/browser_plugin_permission_type.h" |
14 #include "content/public/common/media_stream_request.h" | 14 #include "content/public/common/media_stream_request.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" |
15 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
| 22 class ColorChooser; |
21 class JavaScriptDialogManager; | 23 class JavaScriptDialogManager; |
| 24 class WebContents; |
| 25 struct ColorSuggestion; |
22 struct ContextMenuParams; | 26 struct ContextMenuParams; |
| 27 struct FileChooserParams; |
23 struct NativeWebKeyboardEvent; | 28 struct NativeWebKeyboardEvent; |
24 class WebContents; | |
25 | 29 |
26 // Objects implement this interface to get notified about changes in the guest | 30 // Objects implement this interface to get notified about changes in the guest |
27 // WebContents and to provide necessary functionality. | 31 // WebContents and to provide necessary functionality. |
28 class CONTENT_EXPORT BrowserPluginGuestDelegate { | 32 class CONTENT_EXPORT BrowserPluginGuestDelegate { |
29 public: | 33 public: |
30 virtual ~BrowserPluginGuestDelegate() {} | 34 virtual ~BrowserPluginGuestDelegate() {} |
31 | 35 |
32 // Add a message to the console. | 36 // Add a message to the console. |
33 virtual void AddMessageToConsole(int32 level, | 37 virtual void AddMessageToConsole(int32 level, |
34 const base::string16& message, | 38 const base::string16& message, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // Invoking the |callback| synchronously is OK. | 138 // Invoking the |callback| synchronously is OK. |
135 virtual void RequestPointerLockPermission( | 139 virtual void RequestPointerLockPermission( |
136 bool user_gesture, | 140 bool user_gesture, |
137 bool last_unlocked_by_target, | 141 bool last_unlocked_by_target, |
138 const base::Callback<void(bool)>& callback) {} | 142 const base::Callback<void(bool)>& callback) {} |
139 | 143 |
140 // Returns a pointer to a service to manage JavaScript dialogs. May return | 144 // Returns a pointer to a service to manage JavaScript dialogs. May return |
141 // NULL in which case dialogs aren't shown. | 145 // NULL in which case dialogs aren't shown. |
142 virtual JavaScriptDialogManager* GetJavaScriptDialogManager(); | 146 virtual JavaScriptDialogManager* GetJavaScriptDialogManager(); |
143 | 147 |
| 148 // Called when color chooser should open. Returns the opened color chooser. |
| 149 // Returns NULL if we failed to open the color chooser (e.g. when there is a |
| 150 // ColorChooserDialog already open on Windows). Ownership of the returned |
| 151 // pointer is transferred to the caller. |
| 152 virtual ColorChooser* OpenColorChooser( |
| 153 WebContents* web_contents, |
| 154 SkColor color, |
| 155 const std::vector<ColorSuggestion>& suggestions); |
| 156 |
| 157 // Called when a file selection is to be done. |
| 158 virtual void RunFileChooser(WebContents* web_contents, |
| 159 const FileChooserParams& params) {} |
| 160 |
144 // Returns true if the context menu operation was handled by the delegate. | 161 // Returns true if the context menu operation was handled by the delegate. |
145 virtual bool HandleContextMenu(const ContextMenuParams& params); | 162 virtual bool HandleContextMenu(const ContextMenuParams& params); |
146 }; | 163 }; |
147 | 164 |
148 } // namespace content | 165 } // namespace content |
149 | 166 |
150 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 167 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
OLD | NEW |