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 #include "chrome/browser/extensions/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/ui/browser_list.h" | 28 #include "chrome/browser/ui/browser_list.h" |
29 #include "chrome/browser/ui/browser_window.h" | 29 #include "chrome/browser/ui/browser_window.h" |
30 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" | 30 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
31 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 31 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
32 #include "chrome/browser/view_type_utils.h" | 32 #include "chrome/browser/view_type_utils.h" |
33 #include "chrome/common/chrome_constants.h" | 33 #include "chrome/common/chrome_constants.h" |
34 #include "chrome/common/chrome_notification_types.h" | 34 #include "chrome/common/chrome_notification_types.h" |
35 #include "chrome/common/extensions/extension.h" | 35 #include "chrome/common/extensions/extension.h" |
36 #include "chrome/common/extensions/extension_constants.h" | 36 #include "chrome/common/extensions/extension_constants.h" |
37 #include "chrome/common/extensions/extension_messages.h" | 37 #include "chrome/common/extensions/extension_messages.h" |
| 38 #include "chrome/common/extensions/feature_switch.h" |
| 39 #include "chrome/common/extensions/request_media_access_permission_helper.h" |
38 #include "chrome/common/render_messages.h" | 40 #include "chrome/common/render_messages.h" |
39 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
40 #include "content/public/browser/content_browser_client.h" | 42 #include "content/public/browser/content_browser_client.h" |
41 #include "content/public/browser/native_web_keyboard_event.h" | 43 #include "content/public/browser/native_web_keyboard_event.h" |
42 #include "content/public/browser/notification_service.h" | 44 #include "content/public/browser/notification_service.h" |
43 #include "content/public/browser/render_process_host.h" | 45 #include "content/public/browser/render_process_host.h" |
44 #include "content/public/browser/render_view_host.h" | 46 #include "content/public/browser/render_view_host.h" |
45 #include "content/public/browser/site_instance.h" | 47 #include "content/public/browser/site_instance.h" |
46 #include "content/public/browser/web_contents.h" | 48 #include "content/public/browser/web_contents.h" |
47 #include "content/public/browser/web_contents_view.h" | 49 #include "content/public/browser/web_contents_view.h" |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 initial_pos, user_gesture); | 635 initial_pos, user_gesture); |
634 } | 636 } |
635 | 637 |
636 void ExtensionHost::RenderViewReady() { | 638 void ExtensionHost::RenderViewReady() { |
637 content::NotificationService::current()->Notify( | 639 content::NotificationService::current()->Notify( |
638 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 640 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
639 content::Source<Profile>(profile_), | 641 content::Source<Profile>(profile_), |
640 content::Details<ExtensionHost>(this)); | 642 content::Details<ExtensionHost>(this)); |
641 } | 643 } |
642 | 644 |
| 645 void ExtensionHost::RequestMediaAccessPermission( |
| 646 content::WebContents* web_contents, |
| 647 const content::MediaStreamRequest* request, |
| 648 const content::MediaResponseCallback& callback) { |
| 649 // For tab capture device, we require the tabCapture permission. |
| 650 RequestMediaAccessPermissionHelper::AuthorizeRequest( |
| 651 request, |
| 652 callback, |
| 653 false, |
| 654 false, |
| 655 FeatureSwitch::tab_capture()->IsEnabled() && |
| 656 extension()->HasAPIPermission(APIPermission::kTabCapture)); |
| 657 } |
| 658 |
643 } // namespace extensions | 659 } // namespace extensions |
OLD | NEW |