| 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 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.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/media_stream_request.h" | 16 #include "content/public/common/media_stream_request.h" |
| 17 #include "content/public/common/page_transition_types.h" | 17 #include "content/public/common/page_transition_types.h" |
| 18 #include "content/public/common/window_container_type.h" | 18 #include "content/public/common/window_container_type.h" |
| 19 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
| 20 #include "ui/base/window_open_disposition.h" | 20 #include "ui/base/window_open_disposition.h" |
| 21 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
| 22 #include "ui/gfx/rect_f.h" | 22 #include "ui/gfx/rect_f.h" |
| 23 | 23 |
| 24 class FilePath; | |
| 25 class GURL; | 24 class GURL; |
| 26 | 25 |
| 27 namespace base { | 26 namespace base { |
| 27 class FilePath; |
| 28 class ListValue; | 28 class ListValue; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace content { | 31 namespace content { |
| 32 class BrowserContext; | 32 class BrowserContext; |
| 33 class ColorChooser; | 33 class ColorChooser; |
| 34 class DownloadItem; | 34 class DownloadItem; |
| 35 class JavaScriptDialogManager; | 35 class JavaScriptDialogManager; |
| 36 class RenderViewHost; | 36 class RenderViewHost; |
| 37 class WebContents; | 37 class WebContents; |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 329 |
| 330 // Called when a file selection is to be done. | 330 // Called when a file selection is to be done. |
| 331 virtual void RunFileChooser(WebContents* web_contents, | 331 virtual void RunFileChooser(WebContents* web_contents, |
| 332 const FileChooserParams& params) {} | 332 const FileChooserParams& params) {} |
| 333 | 333 |
| 334 // Request to enumerate a directory. This is equivalent to running the file | 334 // Request to enumerate a directory. This is equivalent to running the file |
| 335 // chooser in directory-enumeration mode and having the user select the given | 335 // chooser in directory-enumeration mode and having the user select the given |
| 336 // directory. | 336 // directory. |
| 337 virtual void EnumerateDirectory(WebContents* web_contents, | 337 virtual void EnumerateDirectory(WebContents* web_contents, |
| 338 int request_id, | 338 int request_id, |
| 339 const FilePath& path) {} | 339 const base::FilePath& path) {} |
| 340 | 340 |
| 341 // Called when the renderer puts a tab into or out of fullscreen mode. | 341 // Called when the renderer puts a tab into or out of fullscreen mode. |
| 342 virtual void ToggleFullscreenModeForTab(WebContents* web_contents, | 342 virtual void ToggleFullscreenModeForTab(WebContents* web_contents, |
| 343 bool enter_fullscreen) {} | 343 bool enter_fullscreen) {} |
| 344 virtual bool IsFullscreenForTabOrPending( | 344 virtual bool IsFullscreenForTabOrPending( |
| 345 const WebContents* web_contents) const; | 345 const WebContents* web_contents) const; |
| 346 | 346 |
| 347 // Called when a Javascript out of memory notification is received. | 347 // Called when a Javascript out of memory notification is received. |
| 348 virtual void JSOutOfMemory(WebContents* web_contents) {} | 348 virtual void JSOutOfMemory(WebContents* web_contents) {} |
| 349 | 349 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 WebContents* web_contents, | 422 WebContents* web_contents, |
| 423 const MediaStreamRequest& request, | 423 const MediaStreamRequest& request, |
| 424 const MediaResponseCallback& callback) {} | 424 const MediaResponseCallback& callback) {} |
| 425 | 425 |
| 426 // Requests permission to access the PPAPI broker. The delegate should return | 426 // Requests permission to access the PPAPI broker. The delegate should return |
| 427 // true and call the passed in |callback| with the result, or return false | 427 // true and call the passed in |callback| with the result, or return false |
| 428 // to indicate that it does not support asking for permission. | 428 // to indicate that it does not support asking for permission. |
| 429 virtual bool RequestPpapiBrokerPermission( | 429 virtual bool RequestPpapiBrokerPermission( |
| 430 WebContents* web_contents, | 430 WebContents* web_contents, |
| 431 const GURL& url, | 431 const GURL& url, |
| 432 const FilePath& plugin_path, | 432 const base::FilePath& plugin_path, |
| 433 const base::Callback<void(bool)>& callback); | 433 const base::Callback<void(bool)>& callback); |
| 434 | 434 |
| 435 protected: | 435 protected: |
| 436 virtual ~WebContentsDelegate(); | 436 virtual ~WebContentsDelegate(); |
| 437 | 437 |
| 438 private: | 438 private: |
| 439 friend class WebContentsImpl; | 439 friend class WebContentsImpl; |
| 440 | 440 |
| 441 // Called when |this| becomes the WebContentsDelegate for |source|. | 441 // Called when |this| becomes the WebContentsDelegate for |source|. |
| 442 void Attach(WebContents* source); | 442 void Attach(WebContents* source); |
| 443 | 443 |
| 444 // Called when |this| is no longer the WebContentsDelegate for |source|. | 444 // Called when |this| is no longer the WebContentsDelegate for |source|. |
| 445 void Detach(WebContents* source); | 445 void Detach(WebContents* source); |
| 446 | 446 |
| 447 // The WebContents that this is currently a delegate for. | 447 // The WebContents that this is currently a delegate for. |
| 448 std::set<WebContents*> attached_contents_; | 448 std::set<WebContents*> attached_contents_; |
| 449 }; | 449 }; |
| 450 | 450 |
| 451 } // namespace content | 451 } // namespace content |
| 452 | 452 |
| 453 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 453 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |