| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "chrome/browser/importer/importer_host.h" | 52 #include "chrome/browser/importer/importer_host.h" |
| 53 #include "chrome/browser/importer/importer_list.h" | 53 #include "chrome/browser/importer/importer_list.h" |
| 54 #include "chrome/browser/instant/instant_controller.h" | 54 #include "chrome/browser/instant/instant_controller.h" |
| 55 #include "chrome/browser/notifications/balloon.h" | 55 #include "chrome/browser/notifications/balloon.h" |
| 56 #include "chrome/browser/notifications/balloon_collection.h" | 56 #include "chrome/browser/notifications/balloon_collection.h" |
| 57 #include "chrome/browser/notifications/notification.h" | 57 #include "chrome/browser/notifications/notification.h" |
| 58 #include "chrome/browser/notifications/notification_ui_manager.h" | 58 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 59 #include "chrome/browser/password_manager/password_store.h" | 59 #include "chrome/browser/password_manager/password_store.h" |
| 60 #include "chrome/browser/password_manager/password_store_change.h" | 60 #include "chrome/browser/password_manager/password_store_change.h" |
| 61 #include "chrome/browser/platform_util.h" | 61 #include "chrome/browser/platform_util.h" |
| 62 #include "chrome/browser/plugin_prefs.h" |
| 62 #include "chrome/browser/prefs/pref_service.h" | 63 #include "chrome/browser/prefs/pref_service.h" |
| 63 #include "chrome/browser/profiles/profile.h" | 64 #include "chrome/browser/profiles/profile.h" |
| 64 #include "chrome/browser/profiles/profile_manager.h" | 65 #include "chrome/browser/profiles/profile_manager.h" |
| 65 #include "chrome/browser/search_engines/template_url.h" | 66 #include "chrome/browser/search_engines/template_url.h" |
| 66 #include "chrome/browser/search_engines/template_url_service.h" | 67 #include "chrome/browser/search_engines/template_url_service.h" |
| 67 #include "chrome/browser/search_engines/template_url_service_factory.h" | 68 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 68 #include "chrome/browser/sessions/restore_tab_helper.h" | 69 #include "chrome/browser/sessions/restore_tab_helper.h" |
| 69 #include "chrome/browser/sessions/session_service_factory.h" | 70 #include "chrome/browser/sessions/session_service_factory.h" |
| 70 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 71 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
| 71 #include "chrome/browser/tab_contents/link_infobar_delegate.h" | 72 #include "chrome/browser/tab_contents/link_infobar_delegate.h" |
| (...skipping 3331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3403 IPC::Message* reply_message) { | 3404 IPC::Message* reply_message) { |
| 3404 if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) { | 3405 if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) { |
| 3405 BrowserThread::PostTask( | 3406 BrowserThread::PostTask( |
| 3406 BrowserThread::FILE, FROM_HERE, | 3407 BrowserThread::FILE, FROM_HERE, |
| 3407 base::Bind(&TestingAutomationProvider::GetPluginsInfo, | 3408 base::Bind(&TestingAutomationProvider::GetPluginsInfo, |
| 3408 this, browser, args, reply_message)); | 3409 this, browser, args, reply_message)); |
| 3409 return; | 3410 return; |
| 3410 } | 3411 } |
| 3411 std::vector<webkit::npapi::WebPluginInfo> plugins; | 3412 std::vector<webkit::npapi::WebPluginInfo> plugins; |
| 3412 webkit::npapi::PluginList::Singleton()->GetPlugins(&plugins); | 3413 webkit::npapi::PluginList::Singleton()->GetPlugins(&plugins); |
| 3414 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(browser->profile()); |
| 3413 ListValue* items = new ListValue; | 3415 ListValue* items = new ListValue; |
| 3414 for (std::vector<webkit::npapi::WebPluginInfo>::const_iterator it = | 3416 for (std::vector<webkit::npapi::WebPluginInfo>::const_iterator it = |
| 3415 plugins.begin(); | 3417 plugins.begin(); |
| 3416 it != plugins.end(); | 3418 it != plugins.end(); |
| 3417 ++it) { | 3419 ++it) { |
| 3418 DictionaryValue* item = new DictionaryValue; | 3420 DictionaryValue* item = new DictionaryValue; |
| 3419 item->SetString("name", it->name); | 3421 item->SetString("name", it->name); |
| 3420 item->SetString("path", it->path.value()); | 3422 item->SetString("path", it->path.value()); |
| 3421 item->SetString("version", it->version); | 3423 item->SetString("version", it->version); |
| 3422 item->SetString("desc", it->desc); | 3424 item->SetString("desc", it->desc); |
| 3423 item->SetBoolean("enabled", webkit::npapi::IsPluginEnabled(*it)); | 3425 item->SetBoolean("enabled", plugin_prefs->IsPluginEnabled(*it)); |
| 3424 // Add info about mime types. | 3426 // Add info about mime types. |
| 3425 ListValue* mime_types = new ListValue(); | 3427 ListValue* mime_types = new ListValue(); |
| 3426 for (std::vector<webkit::npapi::WebPluginMimeType>::const_iterator type_it = | 3428 for (std::vector<webkit::npapi::WebPluginMimeType>::const_iterator type_it = |
| 3427 it->mime_types.begin(); | 3429 it->mime_types.begin(); |
| 3428 type_it != it->mime_types.end(); | 3430 type_it != it->mime_types.end(); |
| 3429 ++type_it) { | 3431 ++type_it) { |
| 3430 DictionaryValue* mime_type = new DictionaryValue(); | 3432 DictionaryValue* mime_type = new DictionaryValue(); |
| 3431 mime_type->SetString("mimeType", type_it->mime_type); | 3433 mime_type->SetString("mimeType", type_it->mime_type); |
| 3432 mime_type->SetString("description", type_it->description); | 3434 mime_type->SetString("description", type_it->description); |
| 3433 | 3435 |
| (...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6160 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 6162 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 6161 | 6163 |
| 6162 Send(reply_message_); | 6164 Send(reply_message_); |
| 6163 redirect_query_ = 0; | 6165 redirect_query_ = 0; |
| 6164 reply_message_ = NULL; | 6166 reply_message_ = NULL; |
| 6165 } | 6167 } |
| 6166 | 6168 |
| 6167 void TestingAutomationProvider::OnRemoveProvider() { | 6169 void TestingAutomationProvider::OnRemoveProvider() { |
| 6168 AutomationProviderList::GetInstance()->RemoveProvider(this); | 6170 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 6169 } | 6171 } |
| OLD | NEW |