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

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

Issue 10843014: Generalize ExtensionIconSet to store icon paths for custom size sets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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 | Annotate | Revision Log
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 if (extension.is_app()) { 135 if (extension.is_app()) {
136 info->app_launch_url.reset(new std::string( 136 info->app_launch_url.reset(new std::string(
137 extension.GetFullLaunchURL().spec())); 137 extension.GetFullLaunchURL().spec()));
138 } 138 }
139 139
140 const ExtensionIconSet::IconMap& icons = extension.icons().map(); 140 const ExtensionIconSet::IconMap& icons = extension.icons().map();
141 if (!icons.empty()) { 141 if (!icons.empty()) {
142 info->icons.reset(new IconInfoList()); 142 info->icons.reset(new IconInfoList());
143 std::map<ExtensionIconSet::Icons, std::string>::const_iterator icon_iter; 143 ExtensionIconSet::IconMap::const_iterator icon_iter;
144 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { 144 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) {
145 management::IconInfo* icon_info = new management::IconInfo(); 145 management::IconInfo* icon_info = new management::IconInfo();
146 icon_info->size = icon_iter->first; 146 icon_info->size = icon_iter->first;
147 GURL url = ExtensionIconSource::GetIconURL( 147 GURL url = ExtensionIconSource::GetIconURL(
148 &extension, icon_info->size, ExtensionIconSet::MATCH_EXACTLY, false, 148 &extension, icon_info->size, ExtensionIconSet::MATCH_EXACTLY, false,
149 NULL); 149 NULL);
150 icon_info->url = url.spec(); 150 icon_info->url = url.spec();
151 info->icons->push_back(make_linked_ptr<management::IconInfo>(icon_info)); 151 info->icons->push_back(make_linked_ptr<management::IconInfo>(icon_info));
152 } 152 }
153 } 153 }
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 } 643 }
644 CHECK(extension); 644 CHECK(extension);
645 scoped_ptr<management::ExtensionInfo> info = CreateExtensionInfo( 645 scoped_ptr<management::ExtensionInfo> info = CreateExtensionInfo(
646 *extension, ExtensionSystem::Get(profile)); 646 *extension, ExtensionSystem::Get(profile));
647 args->Append(info->ToValue().release()); 647 args->Append(info->ToValue().release());
648 } 648 }
649 649
650 profile->GetExtensionEventRouter()->DispatchEventToRenderers( 650 profile->GetExtensionEventRouter()->DispatchEventToRenderers(
651 event_name, args.Pass(), NULL, GURL(), extensions::EventFilteringInfo()); 651 event_name, args.Pass(), NULL, GURL(), extensions::EventFilteringInfo());
652 } 652 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/offline/offline_load_page.cc ('k') | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698