OLD | NEW |
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 "extensions/browser/api/management/management_api.h" | 5 #include "extensions/browser/api/management/management_api.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 155 } |
156 | 156 |
157 const ExtensionIconSet::IconMap& icons = | 157 const ExtensionIconSet::IconMap& icons = |
158 IconsInfo::GetIcons(&extension).map(); | 158 IconsInfo::GetIcons(&extension).map(); |
159 if (!icons.empty()) { | 159 if (!icons.empty()) { |
160 info.icons.reset(new IconInfoList()); | 160 info.icons.reset(new IconInfoList()); |
161 ExtensionIconSet::IconMap::const_iterator icon_iter; | 161 ExtensionIconSet::IconMap::const_iterator icon_iter; |
162 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { | 162 for (icon_iter = icons.begin(); icon_iter != icons.end(); ++icon_iter) { |
163 management::IconInfo icon_info; | 163 management::IconInfo icon_info; |
164 icon_info.size = icon_iter->first; | 164 icon_info.size = icon_iter->first; |
165 GURL url = | 165 GURL url = delegate->GetIconURL(&extension, icon_info.size, |
166 delegate->GetIconURL(&extension, icon_info.size, | 166 ExtensionIconSet::MATCH_EXACTLY, false); |
167 ExtensionIconSet::MATCH_EXACTLY, false, nullptr); | |
168 icon_info.url = url.spec(); | 167 icon_info.url = url.spec(); |
169 info.icons->push_back(std::move(icon_info)); | 168 info.icons->push_back(std::move(icon_info)); |
170 } | 169 } |
171 } | 170 } |
172 | 171 |
173 const std::set<std::string> perms = | 172 const std::set<std::string> perms = |
174 extension.permissions_data()->active_permissions().GetAPIsAsStrings(); | 173 extension.permissions_data()->active_permissions().GetAPIsAsStrings(); |
175 if (!perms.empty()) { | 174 if (!perms.empty()) { |
176 std::set<std::string>::const_iterator perms_iter; | 175 std::set<std::string>::const_iterator perms_iter; |
177 for (perms_iter = perms.begin(); perms_iter != perms.end(); ++perms_iter) | 176 for (perms_iter = perms.begin(); perms_iter != perms.end(); ++perms_iter) |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 ManagementAPI::GetFactoryInstance() { | 883 ManagementAPI::GetFactoryInstance() { |
885 return g_factory.Pointer(); | 884 return g_factory.Pointer(); |
886 } | 885 } |
887 | 886 |
888 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 887 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
889 management_event_router_.reset(new ManagementEventRouter(browser_context_)); | 888 management_event_router_.reset(new ManagementEventRouter(browser_context_)); |
890 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 889 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
891 } | 890 } |
892 | 891 |
893 } // namespace extensions | 892 } // namespace extensions |
OLD | NEW |