| Index: chrome/browser/automation/testing_automation_provider.cc
|
| diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
|
| index 129dc8fd1a6b065b5514265fb8d7b9bd13460756..8f714237581fb89ffb75ce3cde797097131254c6 100644
|
| --- a/chrome/browser/automation/testing_automation_provider.cc
|
| +++ b/chrome/browser/automation/testing_automation_provider.cc
|
| @@ -4,6 +4,10 @@
|
|
|
| #include "chrome/browser/automation/testing_automation_provider.h"
|
|
|
| +#include <map>
|
| +#include <string>
|
| +#include <vector>
|
| +
|
| #include "app/message_box_flags.h"
|
| #include "base/command_line.h"
|
| #include "base/json/json_reader.h"
|
| @@ -2642,7 +2646,7 @@ DownloadItem* GetDownloadItemFromId(int id, DownloadManager* download_manager) {
|
| return selected_item;
|
| }
|
|
|
| -} // namespace
|
| +} // namespace
|
|
|
| // See PerformActionOnDownload() in chrome/test/pyautolib/pyauto.py for sample
|
| // json input and output.
|
| @@ -3038,17 +3042,19 @@ void TestingAutomationProvider::GetPluginsInfo(
|
|
|
| // Sample json input:
|
| // { "command": "EnablePlugin",
|
| +// "name": "Flash Player",
|
| // "path": "/Library/Internet Plug-Ins/Flash Player.plugin" }
|
| void TestingAutomationProvider::EnablePlugin(Browser* browser,
|
| DictionaryValue* args,
|
| IPC::Message* reply_message) {
|
| FilePath::StringType path;
|
| + string16 name;
|
| AutomationJSONReply reply(this, reply_message);
|
| - if (!args->GetString("path", &path)) {
|
| - reply.SendError("path not specified.");
|
| + if (!args->GetString("path", &path) || !args->GetString("name", &name)) {
|
| + reply.SendError("path or name not specified.");
|
| return;
|
| } else if (!webkit::npapi::PluginList::Singleton()->EnablePlugin(
|
| - FilePath(path))) {
|
| + FilePath(path), name)) {
|
| reply.SendError(StringPrintf("Could not enable plugin for path %s.",
|
| path.c_str()));
|
| return;
|
| @@ -3058,17 +3064,19 @@ void TestingAutomationProvider::EnablePlugin(Browser* browser,
|
|
|
| // Sample json input:
|
| // { "command": "DisablePlugin",
|
| +// "name": "Flash Player",
|
| // "path": "/Library/Internet Plug-Ins/Flash Player.plugin" }
|
| void TestingAutomationProvider::DisablePlugin(Browser* browser,
|
| DictionaryValue* args,
|
| IPC::Message* reply_message) {
|
| FilePath::StringType path;
|
| + string16 name;
|
| AutomationJSONReply reply(this, reply_message);
|
| - if (!args->GetString("path", &path)) {
|
| - reply.SendError("path not specified.");
|
| + if (!args->GetString("path", &path) || !args->GetString("name", &name)) {
|
| + reply.SendError("path or name not specified.");
|
| return;
|
| } else if (!webkit::npapi::PluginList::Singleton()->DisablePlugin(
|
| - FilePath(path))) {
|
| + FilePath(path), name)) {
|
| reply.SendError(StringPrintf("Could not disable plugin for path %s.",
|
| path.c_str()));
|
| return;
|
| @@ -3223,7 +3231,7 @@ webkit_glue::PasswordForm GetPasswordFormFromDict(
|
| return password_form;
|
| }
|
|
|
| -} // namespace
|
| +} // namespace
|
|
|
| // See AddSavedPassword() in chrome/test/functional/pyauto.py for sample json
|
| // input.
|
|
|