OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/api/management/management_api.h" | 5 #include "chrome/browser/extensions/api/management/management_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "extensions/browser/extension_registry.h" | 45 #include "extensions/browser/extension_registry.h" |
46 #include "extensions/browser/extension_system.h" | 46 #include "extensions/browser/extension_system.h" |
47 #include "extensions/browser/management_policy.h" | 47 #include "extensions/browser/management_policy.h" |
48 #include "extensions/browser/uninstall_reason.h" | 48 #include "extensions/browser/uninstall_reason.h" |
49 #include "extensions/common/constants.h" | 49 #include "extensions/common/constants.h" |
50 #include "extensions/common/error_utils.h" | 50 #include "extensions/common/error_utils.h" |
51 #include "extensions/common/extension.h" | 51 #include "extensions/common/extension.h" |
52 #include "extensions/common/extension_icon_set.h" | 52 #include "extensions/common/extension_icon_set.h" |
53 #include "extensions/common/manifest_handlers/icons_handler.h" | 53 #include "extensions/common/manifest_handlers/icons_handler.h" |
54 #include "extensions/common/manifest_handlers/offline_enabled_info.h" | 54 #include "extensions/common/manifest_handlers/offline_enabled_info.h" |
| 55 #include "extensions/common/manifest_handlers/options_page_info.h" |
55 #include "extensions/common/permissions/permission_set.h" | 56 #include "extensions/common/permissions/permission_set.h" |
56 #include "extensions/common/permissions/permissions_data.h" | 57 #include "extensions/common/permissions/permissions_data.h" |
57 #include "extensions/common/url_pattern.h" | 58 #include "extensions/common/url_pattern.h" |
58 | 59 |
59 using base::IntToString; | 60 using base::IntToString; |
60 using content::BrowserThread; | 61 using content::BrowserThread; |
61 using content::UtilityProcessHost; | 62 using content::UtilityProcessHost; |
62 using content::UtilityProcessHostClient; | 63 using content::UtilityProcessHostClient; |
63 | 64 |
64 namespace keys = extension_management_api_constants; | 65 namespace keys = extension_management_api_constants; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 scoped_ptr<management::ExtensionInfo> info(new management::ExtensionInfo()); | 120 scoped_ptr<management::ExtensionInfo> info(new management::ExtensionInfo()); |
120 ExtensionService* service = system->extension_service(); | 121 ExtensionService* service = system->extension_service(); |
121 | 122 |
122 info->id = extension.id(); | 123 info->id = extension.id(); |
123 info->name = extension.name(); | 124 info->name = extension.name(); |
124 info->short_name = extension.short_name(); | 125 info->short_name = extension.short_name(); |
125 info->enabled = service->IsExtensionEnabled(info->id); | 126 info->enabled = service->IsExtensionEnabled(info->id); |
126 info->offline_enabled = OfflineEnabledInfo::IsOfflineEnabled(&extension); | 127 info->offline_enabled = OfflineEnabledInfo::IsOfflineEnabled(&extension); |
127 info->version = extension.VersionString(); | 128 info->version = extension.VersionString(); |
128 info->description = extension.description(); | 129 info->description = extension.description(); |
129 info->options_url = ManifestURL::GetOptionsPage(&extension).spec(); | 130 info->options_url = OptionsPageInfo::GetOptionsPage(&extension).spec(); |
130 info->homepage_url.reset(new std::string( | 131 info->homepage_url.reset(new std::string( |
131 ManifestURL::GetHomepageURL(&extension).spec())); | 132 ManifestURL::GetHomepageURL(&extension).spec())); |
132 info->may_disable = system->management_policy()-> | 133 info->may_disable = system->management_policy()-> |
133 UserMayModifySettings(&extension, NULL); | 134 UserMayModifySettings(&extension, NULL); |
134 info->is_app = extension.is_app(); | 135 info->is_app = extension.is_app(); |
135 if (info->is_app) { | 136 if (info->is_app) { |
136 if (extension.is_legacy_packaged_app()) | 137 if (extension.is_legacy_packaged_app()) |
137 info->type = management::ExtensionInfo::TYPE_LEGACY_PACKAGED_APP; | 138 info->type = management::ExtensionInfo::TYPE_LEGACY_PACKAGED_APP; |
138 else if (extension.is_hosted_app()) | 139 else if (extension.is_hosted_app()) |
139 info->type = management::ExtensionInfo::TYPE_HOSTED_APP; | 140 info->type = management::ExtensionInfo::TYPE_HOSTED_APP; |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 ManagementAPI::GetFactoryInstance() { | 1015 ManagementAPI::GetFactoryInstance() { |
1015 return g_factory.Pointer(); | 1016 return g_factory.Pointer(); |
1016 } | 1017 } |
1017 | 1018 |
1018 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 1019 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
1019 management_event_router_.reset(new ManagementEventRouter(browser_context_)); | 1020 management_event_router_.reset(new ManagementEventRouter(browser_context_)); |
1020 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 1021 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
1021 } | 1022 } |
1022 | 1023 |
1023 } // namespace extensions | 1024 } // namespace extensions |
OLD | NEW |