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

Side by Side Diff: chrome/browser/extensions/api/management/management_api.cc

Issue 11786003: Move Icons out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: Created 7 years, 9 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
OLDNEW
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 12 matching lines...) Expand all
23 #include "chrome/browser/extensions/event_router.h" 23 #include "chrome/browser/extensions/event_router.h"
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/icons/icons_handler.h"
33 #include "chrome/common/extensions/api/management.h" 34 #include "chrome/common/extensions/api/management.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_url_handler.h" 38 #include "chrome/common/extensions/manifest_url_handler.h"
38 #include "chrome/common/extensions/permissions/permission_set.h" 39 #include "chrome/common/extensions/permissions/permission_set.h"
39 #include "content/public/browser/notification_details.h" 40 #include "content/public/browser/notification_details.h"
40 #include "content/public/browser/notification_source.h" 41 #include "content/public/browser/notification_source.h"
41 #include "content/public/browser/utility_process_host.h" 42 #include "content/public/browser/utility_process_host.h"
42 #include "content/public/browser/utility_process_host_client.h" 43 #include "content/public/browser/utility_process_host_client.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (!extensions::ManifestURL::GetUpdateURL(&extension).is_empty()) { 132 if (!extensions::ManifestURL::GetUpdateURL(&extension).is_empty()) {
132 info->update_url.reset(new std::string( 133 info->update_url.reset(new std::string(
133 extensions::ManifestURL::GetUpdateURL(&extension).spec())); 134 extensions::ManifestURL::GetUpdateURL(&extension).spec()));
134 } 135 }
135 136
136 if (extension.is_app()) { 137 if (extension.is_app()) {
137 info->app_launch_url.reset(new std::string( 138 info->app_launch_url.reset(new std::string(
138 extension.GetFullLaunchURL().spec())); 139 extension.GetFullLaunchURL().spec()));
139 } 140 }
140 141
141 const ExtensionIconSet::IconMap& icons = extension.icons().map(); 142 const ExtensionIconSet::IconMap& icons =
143 extensions::IconsInfo::GetIcons(&extension).map();
142 if (!icons.empty()) { 144 if (!icons.empty()) {
143 info->icons.reset(new IconInfoList()); 145 info->icons.reset(new IconInfoList());
144 ExtensionIconSet::IconMap::const_iterator icon_iter; 146 ExtensionIconSet::IconMap::const_iterator icon_iter;
145 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { 147 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) {
146 management::IconInfo* icon_info = new management::IconInfo(); 148 management::IconInfo* icon_info = new management::IconInfo();
147 icon_info->size = icon_iter->first; 149 icon_info->size = icon_iter->first;
148 GURL url = ExtensionIconSource::GetIconURL( 150 GURL url = ExtensionIconSource::GetIconURL(
149 &extension, icon_info->size, ExtensionIconSet::MATCH_EXACTLY, false, 151 &extension, icon_info->size, ExtensionIconSet::MATCH_EXACTLY, false,
150 NULL); 152 NULL);
151 icon_info->url = url.spec(); 153 icon_info->url = url.spec();
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { 712 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() {
711 return &g_factory.Get(); 713 return &g_factory.Get();
712 } 714 }
713 715
714 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { 716 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) {
715 management_event_router_.reset(new ManagementEventRouter(profile_)); 717 management_event_router_.reset(new ManagementEventRouter(profile_));
716 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); 718 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
717 } 719 }
718 720
719 } // namespace extensions 721 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698