summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-08 21:47:41 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-08 21:47:41 +0000
commit8f704c814eb2f513ead209887f38c55eea34b636 (patch)
tree28452545c323d7b91f1abcbf44680047755940e6 /chrome/browser/net
parentcdc1e9c09df101960cf95600e97c49936e929c2c (diff)
downloadchromium_src-8f704c814eb2f513ead209887f38c55eea34b636.zip
chromium_src-8f704c814eb2f513ead209887f38c55eea34b636.tar.gz
chromium_src-8f704c814eb2f513ead209887f38c55eea34b636.tar.bz2
Add chrome-user-script:// protocol
This is a step towards getting user scripts working in extensions. It's a bit janky to use the form chrome-user-script://<script file>/ (with no path), but GURL assumes that there is always a host, but path is optional, making this approach simpler than alternatives. Review URL: http://codereview.chromium.org/16592 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7759 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc3
-rw-r--r--chrome/browser/net/chrome_url_request_context.h8
2 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index f68c2c1..2603b296 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/extensions/extensions_service.h"
+#include "chrome/browser/greasemonkey_master.h"
#include "chrome/browser/profile.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
@@ -111,6 +112,8 @@ ChromeURLRequestContext::ChromeURLRequestContext(Profile* profile)
extension_paths_[(*iter)->id()] = (*iter)->path();
}
+ user_script_dir_path_ = profile->GetGreasemonkeyMaster()->user_script_dir();
+
prefs_->AddPrefObserver(prefs::kAcceptLanguages, this);
prefs_->AddPrefObserver(prefs::kCookieBehavior, this);
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index 7cd95f1..9ddbd47 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -39,6 +39,11 @@ class ChromeURLRequestContext : public URLRequestContext,
// Gets the path to the directory for the specified extension.
FilePath GetPathForExtension(const std::string& id);
+ // Gets the path to the directory user scripts are stored in.
+ FilePath user_script_dir_path() const {
+ return user_script_dir_path_;
+ }
+
private:
// Private constructor, use the static factory methods instead. This is
// expected to be called on the UI thread.
@@ -65,6 +70,9 @@ class ChromeURLRequestContext : public URLRequestContext,
// construtor and updated when extensions changed.
ExtensionPaths extension_paths_;
+ // Path to the directory user scripts are stored in.
+ FilePath user_script_dir_path_;
+
scoped_ptr<SQLitePersistentCookieStore> cookie_db_;
PrefService* prefs_;
bool is_off_the_record_;