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

Unified Diff: chrome/browser/extensions/api/management/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: Forgot to remove param from LoadExtensionWithOptions (sorry) 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/api/management/management_api.cc
diff --git a/chrome/browser/extensions/extension_management_api.cc b/chrome/browser/extensions/api/management/management_api.cc
similarity index 95%
rename from chrome/browser/extensions/extension_management_api.cc
rename to chrome/browser/extensions/api/management/management_api.cc
index 928881a2a9bffd06cfb9324f5132f97236816201..3408fedc64354a69efb3f5da19b03448717fcb46 100644
--- a/chrome/browser/extensions/extension_management_api.cc
+++ b/chrome/browser/extensions/api/management/management_api.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/extensions/extension_management_api.h"
+#include "chrome/browser/extensions/api/management/management_api.h"
#include <map>
#include <string>
@@ -13,9 +13,9 @@
#include "base/metrics/histogram.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "chrome/browser/extensions/api/management/management_api_constants.h"
#include "chrome/browser/extensions/event_names.h"
#include "chrome/browser/extensions/event_router.h"
-#include "chrome/browser/extensions/extension_management_api_constants.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
@@ -144,6 +144,27 @@ 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:
+ install_type = keys::kInstallTypeSideload;
+ break;
+ case Extension::EXTERNAL_POLICY_DOWNLOAD:
+ install_type = keys::kInstallTypeAdmin;
+ break;
+ default:
+ install_type = keys::kInstallTypeOther;
+ }
+ info->SetString(keys::kInstallTypeKey, install_type);
+
return info;
}

Powered by Google App Engine
This is Rietveld 408576698