summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-06 20:13:23 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-06 20:13:23 +0000
commit0cd957bf0e56ca2b3520485caf204a289bf82f78 (patch)
treefd4329db311e5961d1eff7a0ca20939f66b3ca9f /chrome
parent90c7aa0fe476246b74608e564ea09f0d2a4951da (diff)
downloadchromium_src-0cd957bf0e56ca2b3520485caf204a289bf82f78.zip
chromium_src-0cd957bf0e56ca2b3520485caf204a289bf82f78.tar.gz
chromium_src-0cd957bf0e56ca2b3520485caf204a289bf82f78.tar.bz2
Adds a command line flag, --user-scripts-dir=..., to specify a directory to use
in place of the default user scripts location. This eases development of userscripts since you can simply point the browser at your SCM checkout location instead of needing to try to sync things into your local userscripts directory. Code review URL: http://codereview.chromium.org/37011 Checking in for slightlyoff git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11146 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/profile.cc11
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
3 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 9289c2a..88bc072 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -381,8 +381,15 @@ void ProfileImpl::InitExtensions() {
FilePath script_dir;
if (user_scripts_enabled) {
- script_dir = GetPath();
- script_dir = script_dir.Append(chrome::kUserScriptsDirname);
+
+ 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.
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 84cc70f..00757ed 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -376,6 +376,9 @@ const wchar_t kLoadExtension[] = L"load-extension";
// Load an NPAPI plugin from the specified path.
const wchar_t kLoadPlugin[] = L"load-plugin";
+// directory to locate user scripts in as an over-ride of the default
+const wchar_t kUserScriptsDir[] = L"user-scripts-dir";
+
// Causes the browser to launch directly in incognito mode.
const wchar_t kIncognito[] = L"incognito";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 7836637..0c4c2e5 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -139,6 +139,7 @@ extern const wchar_t kEnableExtensions[];
extern const wchar_t kInstallExtension[];
extern const wchar_t kLoadExtension[];
extern const wchar_t kLoadPlugin[];
+extern const wchar_t kUserScriptsDir[];
extern const wchar_t kIncognito[];
extern const wchar_t kUseOldSafeBrowsing[];