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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 const char* const kChromecastExtensionIds[] = { | 61 const char* const kChromecastExtensionIds[] = { |
62 "enhhojjnijigcajfphajepfemndkmdlo", // Dev | 62 "enhhojjnijigcajfphajepfemndkmdlo", // Dev |
63 "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Dogfood | 63 "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Dogfood |
64 "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging | 64 "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging |
65 "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary | 65 "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary |
66 "dliochdbjfkdbacpmhlcpmleaejidimm", // Google Cast Beta | 66 "dliochdbjfkdbacpmhlcpmleaejidimm", // Google Cast Beta |
67 "boadgeojelhgndaghljhdicfkmllpafd", // Google Cast Stable | 67 "boadgeojelhgndaghljhdicfkmllpafd", // Google Cast Stable |
68 "hlgmmjhlnlapooncikdpiiokdjcdpjme", // Test cast extension | |
miu
2015/07/17 23:23:14
Rather than add a string to production code that o
| |
68 }; | 69 }; |
69 | 70 |
70 bool TabCaptureCaptureFunction::RunSync() { | 71 bool TabCaptureCaptureFunction::RunSync() { |
71 scoped_ptr<api::tab_capture::Capture::Params> params = | 72 scoped_ptr<api::tab_capture::Capture::Params> params = |
72 TabCapture::Capture::Params::Create(*args_); | 73 TabCapture::Capture::Params::Create(*args_); |
73 EXTENSION_FUNCTION_VALIDATE(params.get()); | 74 EXTENSION_FUNCTION_VALIDATE(params.get()); |
74 | 75 |
75 // Figure out the active WebContents and retrieve the needed ids. | 76 // Figure out the active WebContents and retrieve the needed ids. |
76 Browser* target_browser = chrome::FindAnyBrowser( | 77 Browser* target_browser = chrome::FindAnyBrowser( |
77 GetProfile(), include_incognito(), chrome::GetActiveDesktop()); | 78 GetProfile(), include_incognito(), chrome::GetActiveDesktop()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 bool TabCaptureGetCapturedTabsFunction::RunSync() { | 180 bool TabCaptureGetCapturedTabsFunction::RunSync() { |
180 TabCaptureRegistry* registry = TabCaptureRegistry::Get(GetProfile()); | 181 TabCaptureRegistry* registry = TabCaptureRegistry::Get(GetProfile()); |
181 base::ListValue* const list = new base::ListValue(); | 182 base::ListValue* const list = new base::ListValue(); |
182 if (registry) | 183 if (registry) |
183 registry->GetCapturedTabs(extension()->id(), list); | 184 registry->GetCapturedTabs(extension()->id(), list); |
184 SetResult(list); | 185 SetResult(list); |
185 return true; | 186 return true; |
186 } | 187 } |
187 | 188 |
188 } // namespace extensions | 189 } // namespace extensions |
OLD | NEW |