| 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/callback.h" |
| 13 #include "base/string16.h" | 14 #include "base/string16.h" |
| 14 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 15 #include "content/public/browser/navigation_type.h" | 16 #include "content/public/browser/navigation_type.h" |
| 17 #include "content/public/common/media_stream_request.h" |
| 16 #include "content/public/common/page_transition_types.h" | 18 #include "content/public/common/page_transition_types.h" |
| 17 #include "content/public/common/window_container_type.h" | 19 #include "content/public/common/window_container_type.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
| 20 #include "webkit/glue/window_open_disposition.h" | 22 #include "webkit/glue/window_open_disposition.h" |
| 21 | 23 |
| 22 class FilePath; | 24 class FilePath; |
| 23 class GURL; | 25 class GURL; |
| 24 class WebContentsImpl; | 26 class WebContentsImpl; |
| 25 | 27 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 virtual void WebUISend(WebContents* web_contents, | 402 virtual void WebUISend(WebContents* web_contents, |
| 401 const GURL& source_url, | 403 const GURL& source_url, |
| 402 const std::string& name, | 404 const std::string& name, |
| 403 const base::ListValue& args) {} | 405 const base::ListValue& args) {} |
| 404 | 406 |
| 405 // Requests to lock the mouse. Once the request is approved or rejected, | 407 // Requests to lock the mouse. Once the request is approved or rejected, |
| 406 // GotResponseToLockMouseRequest() will be called on the requesting tab | 408 // GotResponseToLockMouseRequest() will be called on the requesting tab |
| 407 // contents. | 409 // contents. |
| 408 virtual void RequestToLockMouse(WebContents* web_contents, | 410 virtual void RequestToLockMouse(WebContents* web_contents, |
| 409 bool user_gesture, | 411 bool user_gesture, |
| 410 bool last_unlocked_by_target) { | 412 bool last_unlocked_by_target) {} |
| 411 } | |
| 412 | 413 |
| 413 // Notification that the page has lost the mouse lock. | 414 // Notification that the page has lost the mouse lock. |
| 414 virtual void LostMouseLock() {} | 415 virtual void LostMouseLock() {} |
| 415 | 416 |
| 417 // Asks permission to use the camera and/or microphone. If permission is |
| 418 // granted, a call should be made to |callback| with the devices. If the |
| 419 // request is denied, a call should be made to |callback| with an empty list |
| 420 // of devices. |request| has the details of the request (e.g. which of audio |
| 421 // and/or video devices are requested, and lists of available devices). |
| 422 virtual void RequestMediaAccessPermission( |
| 423 WebContents* web_contents, |
| 424 const MediaStreamRequest* request, |
| 425 const MediaResponseCallback& callback) {} |
| 426 |
| 416 protected: | 427 protected: |
| 417 virtual ~WebContentsDelegate(); | 428 virtual ~WebContentsDelegate(); |
| 418 | 429 |
| 419 private: | 430 private: |
| 420 friend class ::WebContentsImpl; | 431 friend class ::WebContentsImpl; |
| 421 | 432 |
| 422 // Called when |this| becomes the WebContentsDelegate for |source|. | 433 // Called when |this| becomes the WebContentsDelegate for |source|. |
| 423 void Attach(WebContents* source); | 434 void Attach(WebContents* source); |
| 424 | 435 |
| 425 // Called when |this| is no longer the WebContentsDelegate for |source|. | 436 // Called when |this| is no longer the WebContentsDelegate for |source|. |
| 426 void Detach(WebContents* source); | 437 void Detach(WebContents* source); |
| 427 | 438 |
| 428 // The WebContents that this is currently a delegate for. | 439 // The WebContents that this is currently a delegate for. |
| 429 std::set<WebContents*> attached_contents_; | 440 std::set<WebContents*> attached_contents_; |
| 430 }; | 441 }; |
| 431 | 442 |
| 432 } // namespace content | 443 } // namespace content |
| 433 | 444 |
| 434 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 445 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |