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 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // Asks permission to use the camera and/or microphone. If permission is | 411 // Asks permission to use the camera and/or microphone. If permission is |
412 // granted, a call should be made to |callback| with the devices. If the | 412 // granted, a call should be made to |callback| with the devices. If the |
413 // request is denied, a call should be made to |callback| with an empty list | 413 // request is denied, a call should be made to |callback| with an empty list |
414 // of devices. |request| has the details of the request (e.g. which of audio | 414 // of devices. |request| has the details of the request (e.g. which of audio |
415 // and/or video devices are requested, and lists of available devices). | 415 // and/or video devices are requested, and lists of available devices). |
416 virtual void RequestMediaAccessPermission( | 416 virtual void RequestMediaAccessPermission( |
417 WebContents* web_contents, | 417 WebContents* web_contents, |
418 const MediaStreamRequest* request, | 418 const MediaStreamRequest* request, |
419 const MediaResponseCallback& callback) {} | 419 const MediaResponseCallback& callback) {} |
420 | 420 |
| 421 // Requests permission to access the PPAPI broker. The delegate should return |
| 422 // true and call the passed in |callback| with the result, or return false |
| 423 // to indicate that it does not support asking for permission. |
| 424 virtual bool RequestPpapiBrokerPermission( |
| 425 WebContents* web_contents, |
| 426 const GURL& url, |
| 427 const FilePath& plugin_path, |
| 428 const base::Callback<void(bool)>& callback); |
| 429 |
421 protected: | 430 protected: |
422 virtual ~WebContentsDelegate(); | 431 virtual ~WebContentsDelegate(); |
423 | 432 |
424 private: | 433 private: |
425 friend class WebContentsImpl; | 434 friend class WebContentsImpl; |
426 | 435 |
427 // Called when |this| becomes the WebContentsDelegate for |source|. | 436 // Called when |this| becomes the WebContentsDelegate for |source|. |
428 void Attach(WebContents* source); | 437 void Attach(WebContents* source); |
429 | 438 |
430 // Called when |this| is no longer the WebContentsDelegate for |source|. | 439 // Called when |this| is no longer the WebContentsDelegate for |source|. |
431 void Detach(WebContents* source); | 440 void Detach(WebContents* source); |
432 | 441 |
433 // The WebContents that this is currently a delegate for. | 442 // The WebContents that this is currently a delegate for. |
434 std::set<WebContents*> attached_contents_; | 443 std::set<WebContents*> attached_contents_; |
435 }; | 444 }; |
436 | 445 |
437 } // namespace content | 446 } // namespace content |
438 | 447 |
439 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 448 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
OLD | NEW |