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/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 3383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3394 Browser* browser, | 3394 Browser* browser, |
3395 DictionaryValue* args, | 3395 DictionaryValue* args, |
3396 IPC::Message* reply_message) { | 3396 IPC::Message* reply_message) { |
3397 if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) { | 3397 if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) { |
3398 BrowserThread::PostTask( | 3398 BrowserThread::PostTask( |
3399 BrowserThread::FILE, FROM_HERE, | 3399 BrowserThread::FILE, FROM_HERE, |
3400 base::Bind(&TestingAutomationProvider::GetPluginsInfo, | 3400 base::Bind(&TestingAutomationProvider::GetPluginsInfo, |
3401 this, browser, args, reply_message)); | 3401 this, browser, args, reply_message)); |
3402 return; | 3402 return; |
3403 } | 3403 } |
3404 std::vector<webkit::npapi::WebPluginInfo> plugins; | 3404 std::vector<webkit::WebPluginInfo> plugins; |
3405 webkit::npapi::PluginList::Singleton()->GetPlugins(&plugins); | 3405 webkit::npapi::PluginList::Singleton()->GetPlugins(&plugins); |
3406 ListValue* items = new ListValue; | 3406 ListValue* items = new ListValue; |
3407 for (std::vector<webkit::npapi::WebPluginInfo>::const_iterator it = | 3407 for (std::vector<webkit::WebPluginInfo>::const_iterator it = |
3408 plugins.begin(); | 3408 plugins.begin(); |
3409 it != plugins.end(); | 3409 it != plugins.end(); |
3410 ++it) { | 3410 ++it) { |
3411 DictionaryValue* item = new DictionaryValue; | 3411 DictionaryValue* item = new DictionaryValue; |
3412 item->SetString("name", it->name); | 3412 item->SetString("name", it->name); |
3413 item->SetString("path", it->path.value()); | 3413 item->SetString("path", it->path.value()); |
3414 item->SetString("version", it->version); | 3414 item->SetString("version", it->version); |
3415 item->SetString("desc", it->desc); | 3415 item->SetString("desc", it->desc); |
3416 item->SetBoolean("enabled", webkit::npapi::IsPluginEnabled(*it)); | 3416 item->SetBoolean("enabled", webkit::IsPluginEnabled(*it)); |
3417 // Add info about mime types. | 3417 // Add info about mime types. |
3418 ListValue* mime_types = new ListValue(); | 3418 ListValue* mime_types = new ListValue(); |
3419 for (std::vector<webkit::npapi::WebPluginMimeType>::const_iterator type_it = | 3419 for (std::vector<webkit::WebPluginMimeType>::const_iterator type_it = |
3420 it->mime_types.begin(); | 3420 it->mime_types.begin(); |
3421 type_it != it->mime_types.end(); | 3421 type_it != it->mime_types.end(); |
3422 ++type_it) { | 3422 ++type_it) { |
3423 DictionaryValue* mime_type = new DictionaryValue(); | 3423 DictionaryValue* mime_type = new DictionaryValue(); |
3424 mime_type->SetString("mimeType", type_it->mime_type); | 3424 mime_type->SetString("mimeType", type_it->mime_type); |
3425 mime_type->SetString("description", type_it->description); | 3425 mime_type->SetString("description", type_it->description); |
3426 | 3426 |
3427 ListValue* file_extensions = new ListValue(); | 3427 ListValue* file_extensions = new ListValue(); |
3428 for (std::vector<std::string>::const_iterator ext_it = | 3428 for (std::vector<std::string>::const_iterator ext_it = |
3429 type_it->file_extensions.begin(); | 3429 type_it->file_extensions.begin(); |
(...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6153 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 6153 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
6154 | 6154 |
6155 Send(reply_message_); | 6155 Send(reply_message_); |
6156 redirect_query_ = 0; | 6156 redirect_query_ = 0; |
6157 reply_message_ = NULL; | 6157 reply_message_ = NULL; |
6158 } | 6158 } |
6159 | 6159 |
6160 void TestingAutomationProvider::OnRemoveProvider() { | 6160 void TestingAutomationProvider::OnRemoveProvider() { |
6161 AutomationProviderList::GetInstance()->RemoveProvider(this); | 6161 AutomationProviderList::GetInstance()->RemoveProvider(this); |
6162 } | 6162 } |
OLD | NEW |