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

Unified Diff: chrome/browser/pdf/pdf_extension_test.cc

Issue 2518493002: Remove obsolete plugin state handling code. (Closed)
Patch Set: Removed unusued function. Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/chrome_plugin_browsertest.cc ('k') | chrome/browser/plugins/plugin_prefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/pdf/pdf_extension_test.cc
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc
index 52e0abb91c1d3ddd7dbdebe7dc38e13beb9e89b6..8220c234d88aaa73165586d9e4c8542b93f44e91 100644
--- a/chrome/browser/pdf/pdf_extension_test.cc
+++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -30,6 +30,7 @@
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/zoom/page_zoom.h"
#include "components/zoom/test/zoom_test_utils.h"
@@ -283,7 +284,6 @@ class PDFExtensionTest : public ExtensionApiTest,
point->SetPoint(x, y);
}
-
};
IN_PROC_BROWSER_TEST_P(PDFExtensionTest, Load) {
@@ -295,21 +295,14 @@ IN_PROC_BROWSER_TEST_P(PDFExtensionTest, Load) {
LoadAllPdfsTest("pdf", GetParam());
}
-class DisablePluginHelper : public content::DownloadManager::Observer,
- public content::NotificationObserver {
+class DisablePluginHelper : public content::DownloadManager::Observer {
public:
DisablePluginHelper() {}
~DisablePluginHelper() override {}
void DisablePlugin(Profile* profile) {
- registrar_.Add(this, chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED,
- content::Source<Profile>(profile));
- scoped_refptr<PluginPrefs> prefs(PluginPrefs::GetForProfile(profile));
- DCHECK(prefs.get());
- prefs->EnablePluginGroup(
- false, base::UTF8ToUTF16(ChromeContentClient::kPDFPluginName));
- // Wait until the plugin has been disabled.
- disable_run_loop_.Run();
+ profile->GetPrefs()->SetBoolean(
+ prefs::kPluginsAlwaysOpenPdfExternally, true);
}
const GURL& GetLastUrl() {
@@ -325,17 +318,8 @@ class DisablePluginHelper : public content::DownloadManager::Observer,
download_run_loop_.Quit();
}
- // content::NotificationObserver implementation.
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override {
- DCHECK_EQ(chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, type);
- disable_run_loop_.Quit();
- }
-
private:
content::NotificationRegistrar registrar_;
- base::RunLoop disable_run_loop_;
base::RunLoop download_run_loop_;
GURL last_url_;
};
« no previous file with comments | « chrome/browser/chrome_plugin_browsertest.cc ('k') | chrome/browser/plugins/plugin_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698