| 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 <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/extensions/management_policy.h" | 27 #include "chrome/browser/extensions/management_policy.h" |
| 28 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
| 29 #include "chrome/browser/ui/extensions/application_launch.h" | 29 #include "chrome/browser/ui/extensions/application_launch.h" |
| 30 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 30 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 31 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
| 32 #include "chrome/common/chrome_utility_messages.h" | 32 #include "chrome/common/chrome_utility_messages.h" |
| 33 #include "chrome/common/extensions/api/management.h" | 33 #include "chrome/common/extensions/api/management.h" |
| 34 #include "chrome/common/extensions/extension.h" | 34 #include "chrome/common/extensions/extension.h" |
| 35 #include "chrome/common/extensions/extension_constants.h" | 35 #include "chrome/common/extensions/extension_constants.h" |
| 36 #include "chrome/common/extensions/extension_icon_set.h" | 36 #include "chrome/common/extensions/extension_icon_set.h" |
| 37 #include "chrome/common/extensions/manifest_url_handler.h" |
| 37 #include "chrome/common/extensions/permissions/permission_set.h" | 38 #include "chrome/common/extensions/permissions/permission_set.h" |
| 38 #include "content/public/browser/notification_details.h" | 39 #include "content/public/browser/notification_details.h" |
| 39 #include "content/public/browser/notification_source.h" | 40 #include "content/public/browser/notification_source.h" |
| 40 #include "content/public/browser/utility_process_host.h" | 41 #include "content/public/browser/utility_process_host.h" |
| 41 #include "content/public/browser/utility_process_host_client.h" | 42 #include "content/public/browser/utility_process_host_client.h" |
| 42 #include "extensions/common/error_utils.h" | 43 #include "extensions/common/error_utils.h" |
| 43 #include "extensions/common/url_pattern.h" | 44 #include "extensions/common/url_pattern.h" |
| 44 | 45 |
| 45 #if !defined(OS_ANDROID) | 46 #if !defined(OS_ANDROID) |
| 46 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 47 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 ExtensionService* service = system->extension_service(); | 90 ExtensionService* service = system->extension_service(); |
| 90 | 91 |
| 91 info->id = extension.id(); | 92 info->id = extension.id(); |
| 92 info->name = extension.name(); | 93 info->name = extension.name(); |
| 93 info->enabled = service->IsExtensionEnabled(info->id); | 94 info->enabled = service->IsExtensionEnabled(info->id); |
| 94 info->offline_enabled = extension.offline_enabled(); | 95 info->offline_enabled = extension.offline_enabled(); |
| 95 info->version = extension.VersionString(); | 96 info->version = extension.VersionString(); |
| 96 info->description = extension.description(); | 97 info->description = extension.description(); |
| 97 info->options_url = extension.options_url().spec(); | 98 info->options_url = extension.options_url().spec(); |
| 98 info->homepage_url.reset(new std::string( | 99 info->homepage_url.reset(new std::string( |
| 99 extension.GetHomepageURL().spec())); | 100 extensions::ManifestURL::GetHomepageURL(&extension).spec())); |
| 100 info->may_disable = system->management_policy()-> | 101 info->may_disable = system->management_policy()-> |
| 101 UserMayModifySettings(&extension, NULL); | 102 UserMayModifySettings(&extension, NULL); |
| 102 info->is_app = extension.is_app(); | 103 info->is_app = extension.is_app(); |
| 103 if (info->is_app) { | 104 if (info->is_app) { |
| 104 if (extension.is_legacy_packaged_app()) | 105 if (extension.is_legacy_packaged_app()) |
| 105 info->type = management::ExtensionInfo::TYPE_LEGACY_PACKAGED_APP; | 106 info->type = management::ExtensionInfo::TYPE_LEGACY_PACKAGED_APP; |
| 106 else if (extension.is_hosted_app()) | 107 else if (extension.is_hosted_app()) |
| 107 info->type = management::ExtensionInfo::TYPE_HOSTED_APP; | 108 info->type = management::ExtensionInfo::TYPE_HOSTED_APP; |
| 108 else | 109 else |
| 109 info->type = management::ExtensionInfo::TYPE_PACKAGED_APP; | 110 info->type = management::ExtensionInfo::TYPE_PACKAGED_APP; |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { | 678 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { |
| 678 return &g_factory.Get(); | 679 return &g_factory.Get(); |
| 679 } | 680 } |
| 680 | 681 |
| 681 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 682 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 682 management_event_router_.reset(new ManagementEventRouter(profile_)); | 683 management_event_router_.reset(new ManagementEventRouter(profile_)); |
| 683 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 684 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 684 } | 685 } |
| 685 | 686 |
| 686 } // namespace extensions | 687 } // namespace extensions |
| OLD | NEW |