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 "chrome/browser/extensions/api/content_settings/content_settings_api.h" | 5 #include "chrome/browser/extensions/api/content_settings/content_settings_api.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 259 } |
260 | 260 |
261 PluginService::GetInstance()->GetPlugins( | 261 PluginService::GetInstance()->GetPlugins( |
262 base::Bind(&ContentSettingsContentSettingGetResourceIdentifiersFunction:: | 262 base::Bind(&ContentSettingsContentSettingGetResourceIdentifiersFunction:: |
263 OnGotPlugins, | 263 OnGotPlugins, |
264 this)); | 264 this)); |
265 return true; | 265 return true; |
266 } | 266 } |
267 | 267 |
268 void ContentSettingsContentSettingGetResourceIdentifiersFunction::OnGotPlugins( | 268 void ContentSettingsContentSettingGetResourceIdentifiersFunction::OnGotPlugins( |
269 const std::vector<webkit::WebPluginInfo>& plugins) { | 269 const std::vector<content::WebPluginInfo>& plugins) { |
270 PluginFinder* finder = PluginFinder::GetInstance(); | 270 PluginFinder* finder = PluginFinder::GetInstance(); |
271 std::set<std::string> group_identifiers; | 271 std::set<std::string> group_identifiers; |
272 base::ListValue* list = new base::ListValue(); | 272 base::ListValue* list = new base::ListValue(); |
273 for (std::vector<webkit::WebPluginInfo>::const_iterator it = plugins.begin(); | 273 for (std::vector<content::WebPluginInfo>::const_iterator it = plugins.begin(); |
274 it != plugins.end(); ++it) { | 274 it != plugins.end(); ++it) { |
275 scoped_ptr<PluginMetadata> plugin_metadata(finder->GetPluginMetadata(*it)); | 275 scoped_ptr<PluginMetadata> plugin_metadata(finder->GetPluginMetadata(*it)); |
276 const std::string& group_identifier = plugin_metadata->identifier(); | 276 const std::string& group_identifier = plugin_metadata->identifier(); |
277 if (group_identifiers.find(group_identifier) != group_identifiers.end()) | 277 if (group_identifiers.find(group_identifier) != group_identifiers.end()) |
278 continue; | 278 continue; |
279 | 279 |
280 group_identifiers.insert(group_identifier); | 280 group_identifiers.insert(group_identifier); |
281 base::DictionaryValue* dict = new base::DictionaryValue(); | 281 base::DictionaryValue* dict = new base::DictionaryValue(); |
282 dict->SetString(keys::kIdKey, group_identifier); | 282 dict->SetString(keys::kIdKey, group_identifier); |
283 dict->SetString(keys::kDescriptionKey, plugin_metadata->name()); | 283 dict->SetString(keys::kDescriptionKey, plugin_metadata->name()); |
284 list->Append(dict); | 284 list->Append(dict); |
285 } | 285 } |
286 SetResult(list); | 286 SetResult(list); |
287 BrowserThread::PostTask( | 287 BrowserThread::PostTask( |
288 BrowserThread::UI, FROM_HERE, base::Bind( | 288 BrowserThread::UI, FROM_HERE, base::Bind( |
289 &ContentSettingsContentSettingGetResourceIdentifiersFunction:: | 289 &ContentSettingsContentSettingGetResourceIdentifiersFunction:: |
290 SendResponse, | 290 SendResponse, |
291 this, | 291 this, |
292 true)); | 292 true)); |
293 } | 293 } |
294 | 294 |
295 } // namespace extensions | 295 } // namespace extensions |
OLD | NEW |