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