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 // Implements the Chrome Extensions Tab Capture API. | 5 // Implements the Chrome Extensions Tab Capture API. |
6 | 6 |
7 #include "chrome/browser/extensions/api/tab_capture/tab_capture_api.h" | 7 #include "chrome/browser/extensions/api/tab_capture/tab_capture_api.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 23 matching lines...) Expand all Loading... |
34 namespace TabCapture = extensions::api::tab_capture; | 34 namespace TabCapture = extensions::api::tab_capture; |
35 namespace GetCapturedTabs = TabCapture::GetCapturedTabs; | 35 namespace GetCapturedTabs = TabCapture::GetCapturedTabs; |
36 | 36 |
37 namespace extensions { | 37 namespace extensions { |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 const char kCapturingSameTab[] = "Cannot capture a tab with an active stream."; | 41 const char kCapturingSameTab[] = "Cannot capture a tab with an active stream."; |
42 const char kFindingTabError[] = "Error finding tab to capture."; | 42 const char kFindingTabError[] = "Error finding tab to capture."; |
43 const char kNoAudioOrVideo[] = "Capture failed. No audio or video requested."; | 43 const char kNoAudioOrVideo[] = "Capture failed. No audio or video requested."; |
44 const char kPermissionError[] = "Tab Capture API flag is not enabled."; | |
45 const char kGrantError[] = | 44 const char kGrantError[] = |
46 "Extension has not been invoked for the current page (see activeTab " | 45 "Extension has not been invoked for the current page (see activeTab " |
47 "permission). Chrome pages cannot be captured."; | 46 "permission). Chrome pages cannot be captured."; |
48 | 47 |
49 // Keys/values for media stream constraints. | 48 // Keys/values for media stream constraints. |
50 const char kMediaStreamSource[] = "chromeMediaSource"; | 49 const char kMediaStreamSource[] = "chromeMediaSource"; |
51 const char kMediaStreamSourceId[] = "chromeMediaSourceId"; | 50 const char kMediaStreamSourceId[] = "chromeMediaSourceId"; |
52 const char kMediaStreamSourceTab[] = "tab"; | 51 const char kMediaStreamSourceTab[] = "tab"; |
53 | 52 |
54 // Whitelisted extensions that do not check for a browser action grant because | 53 // Whitelisted extensions that do not check for a browser action grant because |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 info->tab_id = it->first; | 179 info->tab_id = it->first; |
181 info->status = it->second; | 180 info->status = it->second; |
182 list->Append(info->ToValue().release()); | 181 list->Append(info->ToValue().release()); |
183 } | 182 } |
184 | 183 |
185 SetResult(list); | 184 SetResult(list); |
186 return true; | 185 return true; |
187 } | 186 } |
188 | 187 |
189 } // namespace extensions | 188 } // namespace extensions |
OLD | NEW |