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

Unified Diff: chrome/browser/ui/webui/extensions/extension_basic_info.cc

Issue 16248002: Move Extension::GetBasicInfo to a static helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/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

Powered by Google App Engine
This is Rietveld 408576698