Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3744)

Unified Diff: chrome/browser/extensions/api/tab_capture/tab_capture_api.cc

Issue 850853002: Extensions: Consolidate extension id hashing / searching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
index 1f24b9aa8e837419c8410502a1e6ff07f48fc75d..514cb02523f0b67c7e08c257a3d38580aee0f4ad 100644
--- a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
+++ b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
@@ -51,7 +51,7 @@ const char kMediaStreamSourceTab[] = "tab";
// Whitelisted extensions that do not check for a browser action grant because
// they provide API's.
-const char* const whitelisted_extensions[] = {
+const char* const kWhitelist[] = {
"enhhojjnijigcajfphajepfemndkmdlo", // Dev
"pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Trusted Tester
"fmfcbgogabcbclcofgocippekhfcmgfj", // Staging
@@ -93,9 +93,8 @@ bool TabCaptureCaptureFunction::RunSync() {
switches::kWhitelistedExtensionID) != extension_id &&
!SimpleFeature::IsIdInList(
extension_id,
- std::set<std::string>(
- whitelisted_extensions,
- whitelisted_extensions + arraysize(whitelisted_extensions)))) {
+ std::set<std::string>(kWhitelist,
+ kWhitelist + arraysize(kWhitelist)))) {
error_ = kGrantError;
return false;
}
@@ -141,8 +140,7 @@ bool TabCaptureCaptureFunction::RunSync() {
constraint->SetString(kMediaStreamSourceId, device_id);
}
- extensions::TabCaptureRegistry* registry =
- extensions::TabCaptureRegistry::Get(GetProfile());
+ TabCaptureRegistry* registry = TabCaptureRegistry::Get(GetProfile());
if (!registry->AddRequest(target_contents, extension_id)) {
error_ = kCapturingSameTab;
return false;
@@ -159,8 +157,7 @@ bool TabCaptureCaptureFunction::RunSync() {
}
bool TabCaptureGetCapturedTabsFunction::RunSync() {
- extensions::TabCaptureRegistry* registry =
- extensions::TabCaptureRegistry::Get(GetProfile());
+ TabCaptureRegistry* registry = TabCaptureRegistry::Get(GetProfile());
base::ListValue* const list = new base::ListValue();
if (registry)
registry->GetCapturedTabs(extension()->id(), list);

Powered by Google App Engine
This is Rietveld 408576698