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/media/media_capture_devices_dispatcher.h" | 5 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 } | 58 } |
59 return NULL; | 59 return NULL; |
60 }; | 60 }; |
61 | 61 |
62 // This is a short-term solution to grant camera and/or microphone access to | 62 // This is a short-term solution to grant camera and/or microphone access to |
63 // extensions: | 63 // extensions: |
64 // 1. Virtual keyboard extension. | 64 // 1. Virtual keyboard extension. |
65 // 2. Google Voice Search Hotword extension. | 65 // 2. Google Voice Search Hotword extension. |
66 // 3. Flutter gesture recognition extension. | 66 // 3. Flutter gesture recognition extension. |
| 67 // 4. TODO(smus): Airbender experiment 1. |
| 68 // 5. TODO(smus): Airbender experiment 2. |
67 // Once http://crbug.com/292856 is fixed, remove this whitelist. | 69 // Once http://crbug.com/292856 is fixed, remove this whitelist. |
68 bool IsMediaRequestWhitelistedForExtension( | 70 bool IsMediaRequestWhitelistedForExtension( |
69 const extensions::Extension* extension) { | 71 const extensions::Extension* extension) { |
70 return extension->id() == "mppnpdlheglhdfmldimlhpnegondlapf" || | 72 return extension->id() == "mppnpdlheglhdfmldimlhpnegondlapf" || |
71 extension->id() == "bepbmhgboaologfdajaanbcjmnhjmhfn" || | 73 extension->id() == "bepbmhgboaologfdajaanbcjmnhjmhfn" || |
72 extension->id() == "jokbpnebhdcladagohdnfgjcpejggllo"; | 74 extension->id() == "jokbpnebhdcladagohdnfgjcpejggllo" || |
| 75 extension->id() == "clffjmdilanldobdnedchkdbofoimcgb" || |
| 76 extension->id() == "nnckehldicaciogcbchegobnafnjkcne"; |
73 } | 77 } |
74 | 78 |
75 // This is a short-term solution to allow testing of the the Screen Capture API | 79 // This is a short-term solution to allow testing of the the Screen Capture API |
76 // with Google Hangouts in M27. | 80 // with Google Hangouts in M27. |
77 // TODO(sergeyu): Remove this whitelist as soon as possible. | 81 // TODO(sergeyu): Remove this whitelist as soon as possible. |
78 bool IsOriginWhitelistedForScreenCapture(const GURL& origin) { | 82 bool IsOriginWhitelistedForScreenCapture(const GURL& origin) { |
79 #if defined(OFFICIAL_BUILD) | 83 #if defined(OFFICIAL_BUILD) |
80 if (// Google Hangouts. | 84 if (// Google Hangouts. |
81 (origin.SchemeIs("https") && | 85 (origin.SchemeIs("https") && |
82 EndsWith(origin.spec(), ".talkgadget.google.com/", true)) || | 86 EndsWith(origin.spec(), ".talkgadget.google.com/", true)) || |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 int render_view_id) { | 767 int render_view_id) { |
764 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 768 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
765 FOR_EACH_OBSERVER(Observer, observers_, | 769 FOR_EACH_OBSERVER(Observer, observers_, |
766 OnCreatingAudioStream(render_process_id, render_view_id)); | 770 OnCreatingAudioStream(render_process_id, render_view_id)); |
767 } | 771 } |
768 | 772 |
769 bool MediaCaptureDevicesDispatcher::IsDesktopCaptureInProgress() { | 773 bool MediaCaptureDevicesDispatcher::IsDesktopCaptureInProgress() { |
770 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 774 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
771 return desktop_capture_sessions_.size() > 0; | 775 return desktop_capture_sessions_.size() > 0; |
772 } | 776 } |
OLD | NEW |