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

Side by Side 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: MacOS support patched in. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/message_box_flags.h" 7 #include "app/message_box_flags.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 3043 matching lines...) Expand 10 before | Expand all | Expand 10 after
3054 // { "command": "DisablePlugin", 3054 // { "command": "DisablePlugin",
3055 // "path": "/Library/Internet Plug-Ins/Flash Player.plugin" } 3055 // "path": "/Library/Internet Plug-Ins/Flash Player.plugin" }
3056 void TestingAutomationProvider::DisablePlugin(Browser* browser, 3056 void TestingAutomationProvider::DisablePlugin(Browser* browser,
3057 DictionaryValue* args, 3057 DictionaryValue* args,
3058 IPC::Message* reply_message) { 3058 IPC::Message* reply_message) {
3059 FilePath::StringType path; 3059 FilePath::StringType path;
3060 AutomationJSONReply reply(this, reply_message); 3060 AutomationJSONReply reply(this, reply_message);
3061 if (!args->GetString("path", &path)) { 3061 if (!args->GetString("path", &path)) {
3062 reply.SendError("path not specified."); 3062 reply.SendError("path not specified.");
3063 return; 3063 return;
3064 } else if (!NPAPI::PluginList::Singleton()->DisablePlugin(FilePath(path))) { 3064 } else if (!NPAPI::PluginList::Singleton()->DisablePlugin(
3065 FilePath(path), false)) {
3065 reply.SendError(StringPrintf("Could not disable plugin for path %s.", 3066 reply.SendError(StringPrintf("Could not disable plugin for path %s.",
3066 path.c_str())); 3067 path.c_str()));
3067 return; 3068 return;
3068 } 3069 }
3069 reply.SendSuccess(NULL); 3070 reply.SendSuccess(NULL);
3070 } 3071 }
3071 3072
3072 // Sample json input: 3073 // Sample json input:
3073 // { "command": "SaveTabContents", 3074 // { "command": "SaveTabContents",
3074 // "tab_index": 0, 3075 // "tab_index": 0,
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
4515 // If you change this, update Observer for NotificationType::SESSION_END 4516 // If you change this, update Observer for NotificationType::SESSION_END
4516 // below. 4517 // below.
4517 MessageLoop::current()->PostTask(FROM_HERE, 4518 MessageLoop::current()->PostTask(FROM_HERE,
4518 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); 4519 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider));
4519 } 4520 }
4520 } 4521 }
4521 4522
4522 void TestingAutomationProvider::OnRemoveProvider() { 4523 void TestingAutomationProvider::OnRemoveProvider() {
4523 AutomationProviderList::GetInstance()->RemoveProvider(this); 4524 AutomationProviderList::GetInstance()->RemoveProvider(this);
4524 } 4525 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698