summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 22:38:36 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 22:38:36 +0000
commitfaed6e1304f7ba31ed12d42ea3dc694021690afd (patch)
treeb8d3b1b48fe1e3b5d65cd6a7b7a3f6c4348c9086
parentdb5c20877a4159a01019d183e135e1d713421c09 (diff)
downloadchromium_src-faed6e1304f7ba31ed12d42ea3dc694021690afd.zip
chromium_src-faed6e1304f7ba31ed12d42ea3dc694021690afd.tar.gz
chromium_src-faed6e1304f7ba31ed12d42ea3dc694021690afd.tar.bz2
Remove --enable-user-script and associated tests.
This doesn't remove the underlying support from UserScriptMaster; that is a riskier change. BUG=27520 Review URL: http://codereview.chromium.org/418043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32987 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_startup_unittest.cc50
-rw-r--r--chrome/browser/profile.cc23
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/pref_names.cc3
-rw-r--r--chrome/common/pref_names.h1
6 files changed, 7 insertions, 74 deletions
diff --git a/chrome/browser/extensions/extension_startup_unittest.cc b/chrome/browser/extensions/extension_startup_unittest.cc
index 00089ae..2ec4701 100644
--- a/chrome/browser/extensions/extension_startup_unittest.cc
+++ b/chrome/browser/extensions/extension_startup_unittest.cc
@@ -30,8 +30,7 @@
class ExtensionStartupTestBase
: public InProcessBrowserTest, public NotificationObserver {
public:
- ExtensionStartupTestBase()
- : enable_extensions_(false), enable_user_scripts_(false) {
+ ExtensionStartupTestBase() : enable_extensions_(false) {
}
protected:
@@ -61,21 +60,6 @@ class ExtensionStartupTestBase
command_line->AppendSwitch(switches::kDisableExtensions);
}
- if (enable_user_scripts_) {
- command_line->AppendSwitch(switches::kEnableUserScripts);
-
- FilePath src_dir;
- PathService::Get(chrome::DIR_TEST_DATA, &src_dir);
- src_dir = src_dir.AppendASCII("extensions").AppendASCII("good")
- .AppendASCII("Extensions")
- .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
- .AppendASCII("1.0.0.0");
-
- file_util::CreateDirectory(user_scripts_dir_);
- file_util::CopyFile(src_dir.AppendASCII("script2.js"),
- user_scripts_dir_.AppendASCII("script2.user.js"));
- }
-
if (!load_extension_.value().empty()) {
command_line->AppendSwitchWithValue(switches::kLoadExtension,
load_extension_.ToWStringHack());
@@ -159,7 +143,6 @@ class ExtensionStartupTestBase
FilePath extensions_dir_;
FilePath user_scripts_dir_;
bool enable_extensions_;
- bool enable_user_scripts_;
FilePath load_extension_;
NotificationRegistrar registrar_;
};
@@ -204,34 +187,3 @@ IN_PROC_BROWSER_TEST_F(ExtensionsLoadTest, Test) {
WaitForServicesToStart(1, false);
TestInjection(true, true);
}
-
-
-// ExtensionsStartupUserScriptTest
-// Tests that we can startup with --enable-user-scripts and run user scripts and
-// see them do basic things.
-
-class ExtensionsStartupUserScriptTest : public ExtensionStartupTestBase {
- public:
- ExtensionsStartupUserScriptTest() {
- enable_user_scripts_ = true;
- }
-};
-
-IN_PROC_BROWSER_TEST_F(ExtensionsStartupUserScriptTest, Test) {
- WaitForServicesToStart(0, false);
- TestInjection(false, true);
-}
-
-// Ensure we don't inject into chrome:// URLs
-IN_PROC_BROWSER_TEST_F(ExtensionsStartupUserScriptTest, NoInjectIntoChrome) {
- WaitForServicesToStart(0, false);
-
- ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab"));
-
- bool result = false;
- ui_test_utils::ExecuteJavaScriptAndExtractBool(
- browser()->GetSelectedTabContents()->render_view_host(), L"",
- L"window.domAutomationController.send(document.title == 'Modified')",
- &result);
- EXPECT_FALSE(result);
-}
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index a60b7fc..90069dd 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -147,7 +147,6 @@ void Profile::RegisterUserPrefs(PrefService* prefs) {
IDS_SPELLCHECK_DICTIONARY);
prefs->RegisterBooleanPref(prefs::kEnableSpellCheck, true);
prefs->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, true);
- prefs->RegisterBooleanPref(prefs::kEnableUserScripts, false);
#if defined(OS_LINUX)
prefs->RegisterBooleanPref(prefs::kUsesSystemTheme, false);
#endif
@@ -661,25 +660,13 @@ void ProfileImpl::InitExtensions() {
return; // Already initialized.
const CommandLine* command_line = CommandLine::ForCurrentProcess();
- PrefService* prefs = GetPrefs();
- bool user_scripts_enabled =
- command_line->HasSwitch(switches::kEnableUserScripts) ||
- prefs->GetBoolean(prefs::kEnableUserScripts);
-
- FilePath script_dir;
- if (user_scripts_enabled) {
- if (command_line->HasSwitch(switches::kUserScriptsDir)) {
- std::wstring path_string =
- command_line->GetSwitchValue(switches::kUserScriptsDir);
- script_dir = FilePath::FromWStringHack(path_string);
- } else {
- script_dir = GetPath();
- script_dir = script_dir.Append(chrome::kUserScriptsDirname);
- }
- }
-
ExtensionErrorReporter::Init(true); // allow noisy errors.
+
+ FilePath script_dir; // Don't look for user scripts in any directory.
+ // TODO(aa): We should just remove this functionality,
+ // since it isn't used anymore.
user_script_master_ = new UserScriptMaster(script_dir);
+
extensions_service_ = new ExtensionsService(
this,
CommandLine::ForCurrentProcess(),
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index fae9535..13d76c1 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -236,9 +236,6 @@ const char kEnableSync[] = "enable-sync";
// enabled or not.
const char kEnableUserDataDirProfiles[] = "enable-udd-profiles";
-// Enable user script support.
-const char kEnableUserScripts[] = "enable-user-scripts";
-
// Spawn threads to watch for excessive delays in specified message loops.
// User should set breakpoints on Alarm() to examine problematic thread.
// Usage: -enable-watchdog=[ui][io]
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 986effa..06c2581 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -83,7 +83,6 @@ extern const char kEnableSessionStorage[];
extern const char kEnableStatsTable[];
extern const char kEnableSync[];
extern const char kEnableUserDataDirProfiles[];
-extern const char kEnableUserScripts[];
extern const char kEnableWatchdog[];
extern const char kExperimentalSpellcheckerFeatures[];
extern const char kExplicitlyAllowedPorts[];
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index a66aa9a..57ef945 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -536,9 +536,8 @@ const wchar_t kNumFoldersInOtherBookmarkFolder[] =
// Number of keywords.
const wchar_t kNumKeywords[] = L"user_experience_metrics.num_keywords";
-// Whether Extensions or User Scripts are enabled.
+// Whether Extensions are enabled.
const wchar_t kDisableExtensions[] = L"extensions.disabled";
-const wchar_t kEnableUserScripts[] = L"extensions.user_scripts_enabled";
// Boolean which specifies whether the Extension Shelf is visible on all tabs.
const wchar_t kShowExtensionShelf[] = L"extensions.shelf.show_on_all_tabs";
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 9271408..0f6ee3f 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -205,7 +205,6 @@ extern const wchar_t kNumFoldersInOtherBookmarkFolder[];
extern const wchar_t kNumKeywords[];
extern const wchar_t kDisableExtensions[];
-extern const wchar_t kEnableUserScripts[];
extern const wchar_t kShowExtensionShelf[];
extern const wchar_t kLastExtensionsUpdateCheck[];