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

Side by Side 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, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of extension source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h"
6
7 #include "base/values.h"
8 #include "chrome/common/extensions/extension.h"
9 #include "chrome/common/extensions/extension_constants.h"
10 #include "chrome/common/extensions/manifest_handlers/kiosk_enabled_info.h"
11 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h"
12 #include "chrome/common/extensions/manifest_url_handler.h"
13
14 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
15
16 namespace extensions {
17
18 void GetBasicInfo(const Extension* extension,
19 bool enabled,
20 base::DictionaryValue* info) {
21 info->SetString(info_keys::kIdKey, extension->id());
22 info->SetString(info_keys::kNameKey, extension->name());
23 info->SetBoolean(info_keys::kEnabledKey, enabled);
24 info->SetBoolean(info_keys::kKioskEnabledKey,
25 KioskEnabledInfo::IsKioskEnabled(extension));
26 info->SetBoolean(info_keys::kOfflineEnabledKey,
27 OfflineEnabledInfo::IsOfflineEnabled(extension));
28 info->SetString(info_keys::kVersionKey, extension->VersionString());
29 info->SetString(info_keys::kDescriptionKey, extension->description());
30 info->SetString(
31 info_keys::kOptionsUrlKey,
32 ManifestURL::GetOptionsPage(extension).possibly_invalid_spec());
33 info->SetString(
34 info_keys::kHomepageUrlKey,
35 ManifestURL::GetHomepageURL(extension).possibly_invalid_spec());
36 info->SetString(
37 info_keys::kDetailsUrlKey,
38 ManifestURL::GetDetailsURL(extension).possibly_invalid_spec());
39 info->SetBoolean(info_keys::kPackagedAppKey, extension->is_platform_app());
40 }
41
42 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698