OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WEB_CONTENTS_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/navigation_type.h" | 15 #include "content/public/browser/navigation_type.h" |
16 #include "content/public/common/page_transition_types.h" | 16 #include "content/public/common/page_transition_types.h" |
17 #include "content/public/common/window_container_type.h" | 17 #include "content/public/common/window_container_type.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" |
18 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
19 #include "webkit/glue/window_open_disposition.h" | 20 #include "webkit/glue/window_open_disposition.h" |
20 | 21 |
21 class FilePath; | 22 class FilePath; |
22 class GURL; | 23 class GURL; |
23 class TabContents; | 24 class TabContents; |
24 struct NativeWebKeyboardEvent; | 25 struct NativeWebKeyboardEvent; |
25 | 26 |
26 namespace base { | 27 namespace base { |
27 class ListValue; | 28 class ListValue; |
28 } | 29 } |
29 | 30 |
30 namespace content { | 31 namespace content { |
31 class BrowserContext; | 32 class BrowserContext; |
| 33 class ColorChooser; |
32 class DownloadItem; | 34 class DownloadItem; |
33 class JavaScriptDialogCreator; | 35 class JavaScriptDialogCreator; |
34 class WebContents; | 36 class WebContents; |
35 class WebIntentsDispatcher; | 37 class WebIntentsDispatcher; |
36 struct ContextMenuParams; | 38 struct ContextMenuParams; |
37 struct FileChooserParams; | 39 struct FileChooserParams; |
38 struct SSLStatus; | 40 struct SSLStatus; |
39 } | 41 } |
40 | 42 |
41 namespace gfx { | 43 namespace gfx { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 302 |
301 // Invoked when navigating to a pending entry. When invoked the | 303 // Invoked when navigating to a pending entry. When invoked the |
302 // NavigationController has configured its pending entry, but it has not yet | 304 // NavigationController has configured its pending entry, but it has not yet |
303 // been committed. | 305 // been committed. |
304 virtual void DidNavigateToPendingEntry(WebContents* tab) {} | 306 virtual void DidNavigateToPendingEntry(WebContents* tab) {} |
305 | 307 |
306 // Returns a pointer to a service to create JavaScript dialogs. May return | 308 // Returns a pointer to a service to create JavaScript dialogs. May return |
307 // NULL in which case dialogs aren't shown. | 309 // NULL in which case dialogs aren't shown. |
308 virtual JavaScriptDialogCreator* GetJavaScriptDialogCreator(); | 310 virtual JavaScriptDialogCreator* GetJavaScriptDialogCreator(); |
309 | 311 |
| 312 // Called when color chooser should open. Returns the opened color chooser. |
| 313 virtual content::ColorChooser* OpenColorChooser(WebContents* tab, |
| 314 int color_chooser_id, |
| 315 const SkColor& color); |
| 316 |
| 317 virtual void DidEndColorChooser() {} |
| 318 |
310 // Called when a file selection is to be done. | 319 // Called when a file selection is to be done. |
311 virtual void RunFileChooser(WebContents* tab, | 320 virtual void RunFileChooser(WebContents* tab, |
312 const FileChooserParams& params) {} | 321 const FileChooserParams& params) {} |
313 | 322 |
314 // Request to enumerate a directory. This is equivalent to running the file | 323 // Request to enumerate a directory. This is equivalent to running the file |
315 // chooser in directory-enumeration mode and having the user select the given | 324 // chooser in directory-enumeration mode and having the user select the given |
316 // directory. | 325 // directory. |
317 virtual void EnumerateDirectory(WebContents* tab, | 326 virtual void EnumerateDirectory(WebContents* tab, |
318 int request_id, | 327 int request_id, |
319 const FilePath& path) {} | 328 const FilePath& path) {} |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 // Called when |this| is no longer the WebContentsDelegate for |source|. | 397 // Called when |this| is no longer the WebContentsDelegate for |source|. |
389 void Detach(WebContents* source); | 398 void Detach(WebContents* source); |
390 | 399 |
391 // The WebContents that this is currently a delegate for. | 400 // The WebContents that this is currently a delegate for. |
392 std::set<WebContents*> attached_contents_; | 401 std::set<WebContents*> attached_contents_; |
393 }; | 402 }; |
394 | 403 |
395 } // namespace content | 404 } // namespace content |
396 | 405 |
397 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 406 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
OLD | NEW |