summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extensions_service.cc5
-rw-r--r--chrome/browser/extensions/user_script_master.cc4
2 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index c469c08..13d43a5 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -162,6 +162,11 @@ bool ExtensionsServiceBackend::LoadExtensionsFromDirectory(
const FilePath& path_in,
scoped_refptr<ExtensionsServiceFrontendInterface> frontend) {
FilePath path = path_in;
+
+ // Create the <Profile>/Extensions directory if it doesn't exist.
+ if (!file_util::DirectoryExists(path))
+ file_util::CreateDirectory(path);
+
if (!file_util::AbsolutePath(&path))
NOTREACHED();
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc
index 23ef66f..a6af109 100644
--- a/chrome/browser/extensions/user_script_master.cc
+++ b/chrome/browser/extensions/user_script_master.cc
@@ -147,6 +147,10 @@ base::SharedMemory* UserScriptMaster::ScriptReloader::GetNewScripts(
// Find all the scripts in |script_dir|.
if (!script_dir.value().empty()) {
+ // Create the "<Profile>/User Scripts" directory if it doesn't exist
+ if (!file_util::DirectoryExists(script_dir))
+ file_util::CreateDirectory(script_dir);
+
file_util::FileEnumerator enumerator(script_dir, false,
file_util::FileEnumerator::FILES,
FILE_PATH_LITERAL("*.user.js"));