| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Tab Capture-specific video constraint to enable automatic resolution/rate | 51 // Tab Capture-specific video constraint to enable automatic resolution/rate |
| 52 // throttling mode in the capture pipeline. | 52 // throttling mode in the capture pipeline. |
| 53 const char kEnableAutoThrottlingKey[] = "enableAutoThrottling"; | 53 const char kEnableAutoThrottlingKey[] = "enableAutoThrottling"; |
| 54 | 54 |
| 55 } // namespace | 55 } // namespace |
| 56 | 56 |
| 57 // Whitelisted extensions that do not check for a browser action grant because | 57 // Whitelisted extensions that do not check for a browser action grant because |
| 58 // they provide API's. If there are additional extension ids that need | 58 // they provide API's. If there are additional extension ids that need |
| 59 // whitelisting and are *not* the Chromecast extension, add them to a new | 59 // whitelisting and are *not* the Chromecast extension, add them to a new |
| 60 // kWhitelist array. | 60 // kWhitelist array. |
| 61 // |
| 62 // This list is also used by CastConfigDelegateChromeos to find official Cast |
| 63 // extensions. |
| 61 const char* const kChromecastExtensionIds[] = { | 64 const char* const kChromecastExtensionIds[] = { |
| 62 "enhhojjnijigcajfphajepfemndkmdlo", // Dev | 65 "enhhojjnijigcajfphajepfemndkmdlo", // Dev |
| 63 "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Dogfood | 66 "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Dogfood |
| 64 "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging | 67 "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging |
| 65 "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary | 68 "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary |
| 66 "dliochdbjfkdbacpmhlcpmleaejidimm", // Google Cast Beta | 69 "dliochdbjfkdbacpmhlcpmleaejidimm", // Google Cast Beta |
| 67 "boadgeojelhgndaghljhdicfkmllpafd", // Google Cast Stable | 70 "boadgeojelhgndaghljhdicfkmllpafd", // Google Cast Stable |
| 71 "hlgmmjhlnlapooncikdpiiokdjcdpjme", // Test cast extension |
| 68 }; | 72 }; |
| 69 | 73 |
| 70 bool TabCaptureCaptureFunction::RunSync() { | 74 bool TabCaptureCaptureFunction::RunSync() { |
| 71 scoped_ptr<api::tab_capture::Capture::Params> params = | 75 scoped_ptr<api::tab_capture::Capture::Params> params = |
| 72 TabCapture::Capture::Params::Create(*args_); | 76 TabCapture::Capture::Params::Create(*args_); |
| 73 EXTENSION_FUNCTION_VALIDATE(params.get()); | 77 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 74 | 78 |
| 75 // Figure out the active WebContents and retrieve the needed ids. | 79 // Figure out the active WebContents and retrieve the needed ids. |
| 76 Browser* target_browser = chrome::FindAnyBrowser( | 80 Browser* target_browser = chrome::FindAnyBrowser( |
| 77 GetProfile(), include_incognito(), chrome::GetActiveDesktop()); | 81 GetProfile(), include_incognito(), chrome::GetActiveDesktop()); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool TabCaptureGetCapturedTabsFunction::RunSync() { | 183 bool TabCaptureGetCapturedTabsFunction::RunSync() { |
| 180 TabCaptureRegistry* registry = TabCaptureRegistry::Get(GetProfile()); | 184 TabCaptureRegistry* registry = TabCaptureRegistry::Get(GetProfile()); |
| 181 base::ListValue* const list = new base::ListValue(); | 185 base::ListValue* const list = new base::ListValue(); |
| 182 if (registry) | 186 if (registry) |
| 183 registry->GetCapturedTabs(extension()->id(), list); | 187 registry->GetCapturedTabs(extension()->id(), list); |
| 184 SetResult(list); | 188 SetResult(list); |
| 185 return true; | 189 return true; |
| 186 } | 190 } |
| 187 | 191 |
| 188 } // namespace extensions | 192 } // namespace extensions |
| OLD | NEW |