| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 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 = extension.api_permissions(); | 94 const std::set<std::string> perms = |
| 95 extension.permission_set().GetAPIsAsStrings(); |
| 95 ListValue* permission_list = new ListValue(); | 96 ListValue* permission_list = new ListValue(); |
| 96 if (!perms.empty()) { | 97 if (!perms.empty()) { |
| 97 std::set<std::string>::const_iterator perms_iter; | 98 std::set<std::string>::const_iterator perms_iter; |
| 98 for (perms_iter = perms.begin(); perms_iter != perms.end(); ++perms_iter) { | 99 for (perms_iter = perms.begin(); perms_iter != perms.end(); ++perms_iter) { |
| 99 StringValue* permission_name = new StringValue(*perms_iter); | 100 StringValue* permission_name = new StringValue(*perms_iter); |
| 100 permission_list->Append(permission_name); | 101 permission_list->Append(permission_name); |
| 101 } | 102 } |
| 102 } | 103 } |
| 103 info->Set("permissions", permission_list); | 104 info->Set("permissions", permission_list); |
| 104 | 105 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; | 319 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; |
| 319 args.Append(CreateExtensionInfo(*extension, enabled)); | 320 args.Append(CreateExtensionInfo(*extension, enabled)); |
| 320 } | 321 } |
| 321 | 322 |
| 322 std::string args_json; | 323 std::string args_json; |
| 323 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); | 324 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); |
| 324 | 325 |
| 325 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 326 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 326 event_name, args_json, NULL, GURL()); | 327 event_name, args_json, NULL, GURL()); |
| 327 } | 328 } |
| OLD | NEW |