Index: chrome/browser/ui/webui/extensions/extension_basic_info.cc |
diff --git a/chrome/browser/ui/webui/extensions/extension_basic_info.cc b/chrome/browser/ui/webui/extensions/extension_basic_info.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..40b40a59c08f99a4e024b5314a7d3465ef19777d |
--- /dev/null |
+++ b/chrome/browser/ui/webui/extensions/extension_basic_info.cc |
@@ -0,0 +1,42 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of extension source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/webui/extensions/extension_basic_info.h" |
+ |
+#include "base/values.h" |
+#include "chrome/common/extensions/extension.h" |
+#include "chrome/common/extensions/extension_constants.h" |
+#include "chrome/common/extensions/manifest_handlers/kiosk_enabled_info.h" |
+#include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h" |
+#include "chrome/common/extensions/manifest_url_handler.h" |
+ |
+namespace info_keys = extension_info_keys; |
James Hawkins
2013/06/03 16:43:56
Does this save you anything? You're already wrapp
Yoyo Zhou
2013/06/03 19:35:30
It turns out the values aren't used anywhere else
|
+ |
+namespace extensions { |
+ |
+void GetBasicInfo(const Extension* extension, |
+ bool enabled, |
+ base::DictionaryValue* info) { |
+ info->SetString(info_keys::kIdKey, extension->id()); |
+ info->SetString(info_keys::kNameKey, extension->name()); |
+ info->SetBoolean(info_keys::kEnabledKey, enabled); |
+ info->SetBoolean(info_keys::kKioskEnabledKey, |
+ KioskEnabledInfo::IsKioskEnabled(extension)); |
+ info->SetBoolean(info_keys::kOfflineEnabledKey, |
+ OfflineEnabledInfo::IsOfflineEnabled(extension)); |
+ info->SetString(info_keys::kVersionKey, extension->VersionString()); |
+ info->SetString(info_keys::kDescriptionKey, extension->description()); |
+ info->SetString( |
+ info_keys::kOptionsUrlKey, |
+ ManifestURL::GetOptionsPage(extension).possibly_invalid_spec()); |
+ info->SetString( |
+ info_keys::kHomepageUrlKey, |
+ ManifestURL::GetHomepageURL(extension).possibly_invalid_spec()); |
+ info->SetString( |
+ info_keys::kDetailsUrlKey, |
+ ManifestURL::GetDetailsURL(extension).possibly_invalid_spec()); |
+ info->SetBoolean(info_keys::kPackagedAppKey, extension->is_platform_app()); |
+} |
+ |
+} // namespace extensions |