| 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 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/extensions/extension_service.h" | 24 #include "chrome/browser/extensions/extension_service.h" |
| 25 #include "chrome/browser/extensions/extension_system.h" | 25 #include "chrome/browser/extensions/extension_system.h" |
| 26 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 26 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 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/app_launcher_info.h" |
| 34 #include "chrome/common/extensions/extension.h" | 35 #include "chrome/common/extensions/extension.h" |
| 35 #include "chrome/common/extensions/extension_constants.h" | 36 #include "chrome/common/extensions/extension_constants.h" |
| 36 #include "chrome/common/extensions/extension_icon_set.h" | 37 #include "chrome/common/extensions/extension_icon_set.h" |
| 37 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 38 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
| 38 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h" | 39 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h" |
| 39 #include "chrome/common/extensions/manifest_url_handler.h" | 40 #include "chrome/common/extensions/manifest_url_handler.h" |
| 40 #include "chrome/common/extensions/permissions/permission_set.h" | 41 #include "chrome/common/extensions/permissions/permission_set.h" |
| 41 #include "content/public/browser/notification_details.h" | 42 #include "content/public/browser/notification_details.h" |
| 42 #include "content/public/browser/notification_source.h" | 43 #include "content/public/browser/notification_source.h" |
| 43 #include "content/public/browser/utility_process_host.h" | 44 #include "content/public/browser/utility_process_host.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 130 } |
| 130 } | 131 } |
| 131 | 132 |
| 132 if (!ManifestURL::GetUpdateURL(&extension).is_empty()) { | 133 if (!ManifestURL::GetUpdateURL(&extension).is_empty()) { |
| 133 info->update_url.reset(new std::string( | 134 info->update_url.reset(new std::string( |
| 134 ManifestURL::GetUpdateURL(&extension).spec())); | 135 ManifestURL::GetUpdateURL(&extension).spec())); |
| 135 } | 136 } |
| 136 | 137 |
| 137 if (extension.is_app()) { | 138 if (extension.is_app()) { |
| 138 info->app_launch_url.reset(new std::string( | 139 info->app_launch_url.reset(new std::string( |
| 139 extension.GetFullLaunchURL().spec())); | 140 AppLauncherInfo::GetFullLaunchURL(&extension).spec())); |
| 140 } | 141 } |
| 141 | 142 |
| 142 const ExtensionIconSet::IconMap& icons = | 143 const ExtensionIconSet::IconMap& icons = |
| 143 IconsInfo::GetIcons(&extension).map(); | 144 IconsInfo::GetIcons(&extension).map(); |
| 144 if (!icons.empty()) { | 145 if (!icons.empty()) { |
| 145 info->icons.reset(new IconInfoList()); | 146 info->icons.reset(new IconInfoList()); |
| 146 ExtensionIconSet::IconMap::const_iterator icon_iter; | 147 ExtensionIconSet::IconMap::const_iterator icon_iter; |
| 147 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { | 148 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { |
| 148 management::IconInfo* icon_info = new management::IconInfo(); | 149 management::IconInfo* icon_info = new management::IconInfo(); |
| 149 icon_info->size = icon_iter->first; | 150 icon_info->size = icon_iter->first; |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { | 714 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { |
| 714 return &g_factory.Get(); | 715 return &g_factory.Get(); |
| 715 } | 716 } |
| 716 | 717 |
| 717 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 718 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 718 management_event_router_.reset(new ManagementEventRouter(profile_)); | 719 management_event_router_.reset(new ManagementEventRouter(profile_)); |
| 719 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 720 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 720 } | 721 } |
| 721 | 722 |
| 722 } // namespace extensions | 723 } // namespace extensions |
| OLD | NEW |