Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: chrome/common/chrome_paths_win.cc

Issue 5123004: chrome_paths: refactor and sanitize cache directory handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more win Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_paths_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/chrome_paths_internal.h" 5 #include "chrome/common/chrome_paths_internal.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <knownfolders.h> 8 #include <knownfolders.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 20 matching lines...) Expand all
31 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) 31 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result))
32 return false; 32 return false;
33 #if defined(GOOGLE_CHROME_BUILD) 33 #if defined(GOOGLE_CHROME_BUILD)
34 *result = result->Append(FILE_PATH_LITERAL("Google")); 34 *result = result->Append(FILE_PATH_LITERAL("Google"));
35 #endif 35 #endif
36 *result = result->Append(L"Chrome Frame"); 36 *result = result->Append(L"Chrome Frame");
37 *result = result->Append(chrome::kUserDataDirname); 37 *result = result->Append(chrome::kUserDataDirname);
38 return true; 38 return true;
39 } 39 }
40 40
41 void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result) {
42 // This function does more complicated things on Mac/Linux.
43 *result = profile_dir;
44 }
45
41 bool GetUserDocumentsDirectory(FilePath* result) { 46 bool GetUserDocumentsDirectory(FilePath* result) {
42 wchar_t path_buf[MAX_PATH]; 47 wchar_t path_buf[MAX_PATH];
43 if (FAILED(SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, 48 if (FAILED(SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL,
44 SHGFP_TYPE_CURRENT, path_buf))) 49 SHGFP_TYPE_CURRENT, path_buf)))
45 return false; 50 return false;
46 *result = FilePath(path_buf); 51 *result = FilePath(path_buf);
47 return true; 52 return true;
48 } 53 }
49 54
50 // Return a default path for downloads that is safe. 55 // Return a default path for downloads that is safe.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 wchar_t system_buffer[MAX_PATH]; 89 wchar_t system_buffer[MAX_PATH];
85 system_buffer[0] = 0; 90 system_buffer[0] = 0;
86 if (FAILED(SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, 91 if (FAILED(SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL,
87 SHGFP_TYPE_CURRENT, system_buffer))) 92 SHGFP_TYPE_CURRENT, system_buffer)))
88 return false; 93 return false;
89 *result = FilePath(system_buffer); 94 *result = FilePath(system_buffer);
90 return true; 95 return true;
91 } 96 }
92 97
93 } // namespace chrome 98 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698