| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 extension.GetFullLaunchURL().possibly_invalid_spec()); | 80 extension.GetFullLaunchURL().possibly_invalid_spec()); |
| 81 | 81 |
| 82 const ExtensionIconSet::IconMap& icons = extension.icons().map(); | 82 const ExtensionIconSet::IconMap& icons = extension.icons().map(); |
| 83 if (!icons.empty()) { | 83 if (!icons.empty()) { |
| 84 ListValue* icon_list = new ListValue(); | 84 ListValue* icon_list = new ListValue(); |
| 85 std::map<int, std::string>::const_iterator icon_iter; | 85 std::map<int, std::string>::const_iterator icon_iter; |
| 86 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { | 86 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { |
| 87 DictionaryValue* icon_info = new DictionaryValue(); | 87 DictionaryValue* icon_info = new DictionaryValue(); |
| 88 Extension::Icons size = static_cast<Extension::Icons>(icon_iter->first); | 88 Extension::Icons size = static_cast<Extension::Icons>(icon_iter->first); |
| 89 GURL url = ExtensionIconSource::GetIconURL( | 89 GURL url = ExtensionIconSource::GetIconURL( |
| 90 &extension, size, ExtensionIconSet::MATCH_EXACTLY, false); | 90 &extension, size, ExtensionIconSet::MATCH_EXACTLY, false, NULL); |
| 91 icon_info->SetInteger(kSizeKey, icon_iter->first); | 91 icon_info->SetInteger(kSizeKey, icon_iter->first); |
| 92 icon_info->SetString(kUrlKey, url.spec()); | 92 icon_info->SetString(kUrlKey, url.spec()); |
| 93 icon_list->Append(icon_info); | 93 icon_list->Append(icon_info); |
| 94 } | 94 } |
| 95 info->Set("icons", icon_list); | 95 info->Set("icons", icon_list); |
| 96 } | 96 } |
| 97 | 97 |
| 98 const std::set<std::string> perms = | 98 const std::set<std::string> perms = |
| 99 extension.GetActivePermissions()->GetAPIsAsStrings(); | 99 extension.GetActivePermissions()->GetAPIsAsStrings(); |
| 100 ListValue* permission_list = new ListValue(); | 100 ListValue* permission_list = new ListValue(); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; | 473 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; |
| 474 args.Append(CreateExtensionInfo(*extension, enabled)); | 474 args.Append(CreateExtensionInfo(*extension, enabled)); |
| 475 } | 475 } |
| 476 | 476 |
| 477 std::string args_json; | 477 std::string args_json; |
| 478 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); | 478 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); |
| 479 | 479 |
| 480 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 480 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 481 event_name, args_json, NULL, GURL()); | 481 event_name, args_json, NULL, GURL()); |
| 482 } | 482 } |
| OLD | NEW |