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

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

Issue 449048: Move some XDG code from chrome to base. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linux base_unittest Created 11 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.h ('k') | chrome/common/chrome_paths_internal.h » ('j') | 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.h" 5 #include "chrome/common/chrome_paths.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 FilePath cur; 72 FilePath cur;
73 switch (key) { 73 switch (key) {
74 case chrome::DIR_USER_DATA: 74 case chrome::DIR_USER_DATA:
75 if (!GetDefaultUserDataDirectory(&cur)) { 75 if (!GetDefaultUserDataDirectory(&cur)) {
76 NOTREACHED(); 76 NOTREACHED();
77 return false; 77 return false;
78 } 78 }
79 create_dir = true; 79 create_dir = true;
80 break; 80 break;
81 case chrome::DIR_USER_CACHE:
82 #if defined(OS_LINUX)
83 if (!GetUserCacheDirectory(&cur))
84 return false;
85 create_dir = true;
86 #else
87 // No concept of a separate cache directory on non-Linux systems.
88 return false;
89 #endif
90 break;
91 case chrome::DIR_USER_DOCUMENTS: 81 case chrome::DIR_USER_DOCUMENTS:
92 if (!GetUserDocumentsDirectory(&cur)) 82 if (!GetUserDocumentsDirectory(&cur))
93 return false; 83 return false;
94 create_dir = true; 84 create_dir = true;
95 break; 85 break;
96 case chrome::DIR_DEFAULT_DOWNLOADS: 86 case chrome::DIR_DEFAULT_DOWNLOADS:
97 if (!GetUserDownloadsDirectory(&cur)) 87 if (!GetUserDownloadsDirectory(&cur))
98 return false; 88 return false;
99 // Do not create the download directory here, we have done it twice now 89 // Do not create the download directory here, we have done it twice now
100 // and annoyed a lot of users. 90 // and annoyed a lot of users.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 return true; 203 return true;
214 } 204 }
215 205
216 // This cannot be done as a static initializer sadly since Visual Studio will 206 // This cannot be done as a static initializer sadly since Visual Studio will
217 // eliminate this object file if there is no direct entry point into it. 207 // eliminate this object file if there is no direct entry point into it.
218 void RegisterPathProvider() { 208 void RegisterPathProvider() {
219 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 209 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
220 } 210 }
221 211
222 } // namespace chrome 212 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | chrome/common/chrome_paths_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698