Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 5699005: Policy: Re-enabled plugin still disabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes and cleanups. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 fcc609f3f4eb782f5c1feaab73986339aa604fb5..bcc26e6a3e0c85d4983500bf6dc46f3e28f5c963 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.
@@ -3037,16 +3041,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 (!NPAPI::PluginList::Singleton()->EnablePlugin(FilePath(path))) {
+ } else if (!NPAPI::PluginList::Singleton()->EnablePlugin(
+ FilePath(path), name)) {
reply.SendError(StringPrintf("Could not enable plugin for path %s.",
path.c_str()));
return;
@@ -3056,16 +3063,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 (!NPAPI::PluginList::Singleton()->DisablePlugin(FilePath(path))) {
+ } else if (!NPAPI::PluginList::Singleton()->DisablePlugin(
+ FilePath(path), name)) {
reply.SendError(StringPrintf("Could not disable plugin for path %s.",
path.c_str()));
return;
@@ -3220,7 +3230,7 @@ webkit_glue::PasswordForm GetPasswordFormFromDict(
return password_form;
}
-} // namespace
+} // namespace
// See AddSavedPassword() in chrome/test/functional/pyauto.py for sample json
// input.
« no previous file with comments | « no previous file | chrome/browser/chromeos/gview_request_interceptor_unittest.cc » ('j') | webkit/glue/plugins/plugin_group.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698