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

Unified Diff: chrome/browser/extensions/extension_management_api.cc

Issue 10750010: Add an installType property to the management API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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/extension_management_api.cc
diff --git a/chrome/browser/extensions/extension_management_api.cc b/chrome/browser/extensions/extension_management_api.cc
index df9fd2d5ef97237e6487c9ec20d0a0b6e30eea33..9f012c3d8f17fd580d8ee1bcdfb55ad3b4c3b032 100644
--- a/chrome/browser/extensions/extension_management_api.cc
+++ b/chrome/browser/extensions/extension_management_api.cc
@@ -143,6 +143,25 @@ static DictionaryValue* CreateExtensionInfo(const Extension& extension,
}
info->Set(keys::kHostPermissionsKey, host_permission_list);
+ std::string install_type = keys::kInstallTypeOther;
+ switch (extension.location()) {
+ case Extension::INTERNAL:
+ install_type = keys::kInstallTypeNormal;
+ break;
+ case Extension::LOAD:
+ install_type = keys::kInstallTypeDevelopment;
+ break;
+ case Extension::EXTERNAL_PREF:
+ case Extension::EXTERNAL_REGISTRY:
+ case Extension::EXTERNAL_PREF_DOWNLOAD:
+ case Extension::EXTERNAL_POLICY_DOWNLOAD:
+ install_type = keys::kInstallTypeSideload;
+ break;
+ default:
+ install_type = keys::kInstallTypeOther;
+ }
+ info->SetString(keys::kInstallTypeKey, install_type);
+
return info;
}

Powered by Google App Engine
This is Rietveld 408576698