summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 13:49:31 +0000
committerskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 13:49:31 +0000
commit69f27a2a15b5eaf9eebfcedb40ff039df39921e1 (patch)
tree9b3bb56e0a994f14344daa55c39eb67947e0802b /chrome
parentc708db4675caea8773ccf88a5762d33035073e2d (diff)
downloadchromium_src-69f27a2a15b5eaf9eebfcedb40ff039df39921e1.zip
chromium_src-69f27a2a15b5eaf9eebfcedb40ff039df39921e1.tar.gz
chromium_src-69f27a2a15b5eaf9eebfcedb40ff039df39921e1.tar.bz2
Pack content scripts in a temp directory in the profile dir.
BUG=49008 TEST=ExtensionsServiceTest.InstallUserScript Review URL: http://codereview.chromium.org/2961006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/convert_user_script.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc
index 95dab21..b06553a 100644
--- a/chrome/browser/extensions/convert_user_script.cc
+++ b/chrome/browser/extensions/convert_user_script.cc
@@ -10,10 +10,12 @@
#include "base/base64.h"
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/path_service.h"
#include "base/scoped_temp_dir.h"
#include "base/sha2.h"
#include "base/string_util.h"
#include "chrome/browser/extensions/user_script_master.h"
+#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/user_script.h"
@@ -39,8 +41,11 @@ Extension* ConvertUserScriptToExtension(const FilePath& user_script_path,
return NULL;
}
+ FilePath user_data_temp_dir;
+ CHECK(PathService::Get(chrome::DIR_USER_DATA_TEMP, &user_data_temp_dir));
+
ScopedTempDir temp_dir;
- if (!temp_dir.CreateUniqueTempDir()) {
+ if (!temp_dir.CreateUniqueTempDirUnderPath(user_data_temp_dir, false)) {
*error = "Could not create temporary directory.";
return NULL;
}