diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-25 05:08:54 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-25 05:08:54 +0000 |
commit | bdbc87ca87fda52c3262240705d974030e9ed4b4 (patch) | |
tree | 6ca34f4c2ba9fe4b340075206846c115a5400d27 /chrome/browser/net/chrome_url_request_context.cc | |
parent | 1692ea885338dd799ae9f47151d2a7fd4d1b10c4 (diff) | |
download | chromium_src-bdbc87ca87fda52c3262240705d974030e9ed4b4.zip chromium_src-bdbc87ca87fda52c3262240705d974030e9ed4b4.tar.gz chromium_src-bdbc87ca87fda52c3262240705d974030e9ed4b4.tar.bz2 |
Add user script support to extensions.
This is implemented mostly by relying on the existing
user script code. But since extension user scripts are
declared, not discovered in a directory, I had to add
support for adding 'lone' user scripts to
UserScriptMaster. This led to a bit of refactoring.
Note that this CL relies on:
http://codereview.chromium.org/18352
Review URL: http://codereview.chromium.org/18198
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/chrome_url_request_context.cc')
-rw-r--r-- | chrome/browser/net/chrome_url_request_context.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 4c877f5..f11b710 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -105,14 +105,17 @@ ChromeURLRequestContext::ChromeURLRequestContext(Profile* profile) cookie_policy_.SetType(net::CookiePolicy::FromInt( prefs_->GetInteger(prefs::kCookieBehavior))); - const ExtensionList* extensions = - profile->GetExtensionsService()->extensions(); - for (ExtensionList::const_iterator iter = extensions->begin(); - iter != extensions->end(); ++iter) { - extension_paths_[(*iter)->id()] = (*iter)->path(); + if (profile->GetExtensionsService()) { + const ExtensionList* extensions = + profile->GetExtensionsService()->extensions(); + for (ExtensionList::const_iterator iter = extensions->begin(); + iter != extensions->end(); ++iter) { + extension_paths_[(*iter)->id()] = (*iter)->path(); + } } - user_script_dir_path_ = profile->GetUserScriptMaster()->user_script_dir(); + if (profile->GetUserScriptMaster()) + user_script_dir_path_ = profile->GetUserScriptMaster()->user_script_dir(); prefs_->AddPrefObserver(prefs::kAcceptLanguages, this); prefs_->AddPrefObserver(prefs::kCookieBehavior, this); |