OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
9 #include "chrome/common/extensions/manifest_handlers/kiosk_enabled_info.h" | 9 #include "chrome/common/extensions/manifest_handlers/kiosk_mode_info.h" |
10 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h" | 10 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h" |
11 #include "chrome/common/extensions/manifest_url_handler.h" | 11 #include "chrome/common/extensions/manifest_url_handler.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Keys in the dictionary returned by GetExtensionBasicInfo(). | 15 // Keys in the dictionary returned by GetExtensionBasicInfo(). |
16 const char kDescriptionKey[] = "description"; | 16 const char kDescriptionKey[] = "description"; |
17 const char kEnabledKey[] = "enabled"; | 17 const char kEnabledKey[] = "enabled"; |
18 const char kHomepageUrlKey[] = "homepageUrl"; | 18 const char kHomepageUrlKey[] = "homepageUrl"; |
19 const char kIdKey[] = "id"; | 19 const char kIdKey[] = "id"; |
20 const char kNameKey[] = "name"; | 20 const char kNameKey[] = "name"; |
21 const char kKioskEnabledKey[] = "kioskEnabled"; | 21 const char kKioskEnabledKey[] = "kioskEnabled"; |
22 const char kKioskOnlyKey[] = "kioskRequired"; | |
not at google - send to devlin
2013/09/24 18:35:17
kioskOnly?
Tim Song
2013/09/24 18:50:01
Done.
| |
22 const char kOfflineEnabledKey[] = "offlineEnabled"; | 23 const char kOfflineEnabledKey[] = "offlineEnabled"; |
23 const char kOptionsUrlKey[] = "optionsUrl"; | 24 const char kOptionsUrlKey[] = "optionsUrl"; |
24 const char kDetailsUrlKey[] = "detailsUrl"; | 25 const char kDetailsUrlKey[] = "detailsUrl"; |
25 const char kVersionKey[] = "version"; | 26 const char kVersionKey[] = "version"; |
26 const char kPackagedAppKey[] = "packagedApp"; | 27 const char kPackagedAppKey[] = "packagedApp"; |
27 | 28 |
28 } // namespace | 29 } // namespace |
29 | 30 |
30 namespace extensions { | 31 namespace extensions { |
31 | 32 |
32 void GetExtensionBasicInfo(const Extension* extension, | 33 void GetExtensionBasicInfo(const Extension* extension, |
33 bool enabled, | 34 bool enabled, |
34 base::DictionaryValue* info) { | 35 base::DictionaryValue* info) { |
35 info->SetString(kIdKey, extension->id()); | 36 info->SetString(kIdKey, extension->id()); |
36 info->SetString(kNameKey, extension->name()); | 37 info->SetString(kNameKey, extension->name()); |
37 info->SetBoolean(kEnabledKey, enabled); | 38 info->SetBoolean(kEnabledKey, enabled); |
38 info->SetBoolean(kKioskEnabledKey, | 39 info->SetBoolean(kKioskEnabledKey, |
39 KioskEnabledInfo::IsKioskEnabled(extension)); | 40 KioskEnabledInfo::IsKioskEnabled(extension)); |
41 info->SetBoolean(kKioskOnlyKey, | |
42 KioskOnlyInfo::IsKioskOnly(extension)); | |
40 info->SetBoolean(kOfflineEnabledKey, | 43 info->SetBoolean(kOfflineEnabledKey, |
41 OfflineEnabledInfo::IsOfflineEnabled(extension)); | 44 OfflineEnabledInfo::IsOfflineEnabled(extension)); |
42 info->SetString(kVersionKey, extension->VersionString()); | 45 info->SetString(kVersionKey, extension->VersionString()); |
43 info->SetString(kDescriptionKey, extension->description()); | 46 info->SetString(kDescriptionKey, extension->description()); |
44 info->SetString( | 47 info->SetString( |
45 kOptionsUrlKey, | 48 kOptionsUrlKey, |
46 ManifestURL::GetOptionsPage(extension).possibly_invalid_spec()); | 49 ManifestURL::GetOptionsPage(extension).possibly_invalid_spec()); |
47 info->SetString( | 50 info->SetString( |
48 kHomepageUrlKey, | 51 kHomepageUrlKey, |
49 ManifestURL::GetHomepageURL(extension).possibly_invalid_spec()); | 52 ManifestURL::GetHomepageURL(extension).possibly_invalid_spec()); |
50 info->SetString( | 53 info->SetString( |
51 kDetailsUrlKey, | 54 kDetailsUrlKey, |
52 ManifestURL::GetDetailsURL(extension).possibly_invalid_spec()); | 55 ManifestURL::GetDetailsURL(extension).possibly_invalid_spec()); |
53 info->SetBoolean(kPackagedAppKey, extension->is_platform_app()); | 56 info->SetBoolean(kPackagedAppKey, extension->is_platform_app()); |
54 } | 57 } |
55 | 58 |
56 } // namespace extensions | 59 } // namespace extensions |
OLD | NEW |