OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_management_api.h" | 5 #include "chrome/browser/extensions/extension_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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 extension.GetFullLaunchURL().possibly_invalid_spec()); | 76 extension.GetFullLaunchURL().possibly_invalid_spec()); |
77 | 77 |
78 const ExtensionIconSet::IconMap& icons = extension.icons().map(); | 78 const ExtensionIconSet::IconMap& icons = extension.icons().map(); |
79 if (!icons.empty()) { | 79 if (!icons.empty()) { |
80 ListValue* icon_list = new ListValue(); | 80 ListValue* icon_list = new ListValue(); |
81 std::map<int, std::string>::const_iterator icon_iter; | 81 std::map<int, std::string>::const_iterator icon_iter; |
82 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { | 82 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { |
83 DictionaryValue* icon_info = new DictionaryValue(); | 83 DictionaryValue* icon_info = new DictionaryValue(); |
84 Extension::Icons size = static_cast<Extension::Icons>(icon_iter->first); | 84 Extension::Icons size = static_cast<Extension::Icons>(icon_iter->first); |
85 GURL url = ExtensionIconSource::GetIconURL( | 85 GURL url = ExtensionIconSource::GetIconURL( |
86 &extension, size, ExtensionIconSet::MATCH_EXACTLY, false); | 86 &extension, size, ExtensionIconSet::MATCH_EXACTLY, false, NULL); |
87 icon_info->SetInteger(kSizeKey, icon_iter->first); | 87 icon_info->SetInteger(kSizeKey, icon_iter->first); |
88 icon_info->SetString(kUrlKey, url.spec()); | 88 icon_info->SetString(kUrlKey, url.spec()); |
89 icon_list->Append(icon_info); | 89 icon_list->Append(icon_info); |
90 } | 90 } |
91 info->Set("icons", icon_list); | 91 info->Set("icons", icon_list); |
92 } | 92 } |
93 | 93 |
94 const std::set<std::string> perms = | 94 const std::set<std::string> perms = |
95 extension.permission_set()->GetAPIsAsStrings(); | 95 extension.permission_set()->GetAPIsAsStrings(); |
96 ListValue* permission_list = new ListValue(); | 96 ListValue* permission_list = new ListValue(); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; | 315 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; |
316 args.Append(CreateExtensionInfo(*extension, enabled)); | 316 args.Append(CreateExtensionInfo(*extension, enabled)); |
317 } | 317 } |
318 | 318 |
319 std::string args_json; | 319 std::string args_json; |
320 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); | 320 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); |
321 | 321 |
322 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 322 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
323 event_name, args_json, NULL, GURL()); | 323 event_name, args_json, NULL, GURL()); |
324 } | 324 } |
OLD | NEW |