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

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: .. 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 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (!extension.update_url().is_empty()) 95 if (!extension.update_url().is_empty())
96 info->SetString(keys::kUpdateUrlKey, 96 info->SetString(keys::kUpdateUrlKey,
97 extension.update_url().possibly_invalid_spec()); 97 extension.update_url().possibly_invalid_spec());
98 if (extension.is_app()) 98 if (extension.is_app())
99 info->SetString(keys::kAppLaunchUrlKey, 99 info->SetString(keys::kAppLaunchUrlKey,
100 extension.GetFullLaunchURL().possibly_invalid_spec()); 100 extension.GetFullLaunchURL().possibly_invalid_spec());
101 101
102 const ExtensionIconSet::IconMap& icons = extension.icons().map(); 102 const ExtensionIconSet::IconMap& icons = extension.icons().map();
103 if (!icons.empty()) { 103 if (!icons.empty()) {
104 ListValue* icon_list = new ListValue(); 104 ListValue* icon_list = new ListValue();
105 std::map<ExtensionIconSet::Icons, std::string>::const_iterator icon_iter; 105 ExtensionIconSet::IconMap::const_iterator icon_iter;
106 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { 106 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) {
107 DictionaryValue* icon_info = new DictionaryValue(); 107 DictionaryValue* icon_info = new DictionaryValue();
108 ExtensionIconSet::Icons size = icon_iter->first; 108 int size = icon_iter->first;
109 GURL url = ExtensionIconSource::GetIconURL( 109 GURL url = ExtensionIconSource::GetIconURL(
110 &extension, size, ExtensionIconSet::MATCH_EXACTLY, false, NULL); 110 &extension, size, ExtensionIconSet::MATCH_EXACTLY, false, NULL);
111 icon_info->SetInteger(keys::kSizeKey, icon_iter->first); 111 icon_info->SetInteger(keys::kSizeKey, icon_iter->first);
112 icon_info->SetString(keys::kUrlKey, url.spec()); 112 icon_info->SetString(keys::kUrlKey, url.spec());
113 icon_list->Append(icon_info); 113 icon_list->Append(icon_info);
114 } 114 }
115 info->Set(keys::kIconsKey, icon_list); 115 info->Set(keys::kIconsKey, icon_list);
116 } 116 }
117 117
118 const std::set<std::string> perms = 118 const std::set<std::string> perms =
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 extension = content::Details<const Extension>(details).ptr(); 605 extension = content::Details<const Extension>(details).ptr();
606 } 606 }
607 CHECK(extension); 607 CHECK(extension);
608 ExtensionService* service = profile->GetExtensionService(); 608 ExtensionService* service = profile->GetExtensionService();
609 args->Append(CreateExtensionInfo(*extension, service)); 609 args->Append(CreateExtensionInfo(*extension, service));
610 } 610 }
611 611
612 profile->GetExtensionEventRouter()->DispatchEventToRenderers( 612 profile->GetExtensionEventRouter()->DispatchEventToRenderers(
613 event_name, args.Pass(), NULL, GURL(), extensions::EventFilteringInfo()); 613 event_name, args.Pass(), NULL, GURL(), extensions::EventFilteringInfo());
614 } 614 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698