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

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

Issue 10241007: Linux: Use the same safe downloads logic as Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix autocompletion failure Created 8 years, 7 months 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/mac/bundle_locations.h" 10 #include "base/mac/bundle_locations.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 return false; 137 return false;
138 } 138 }
139 create_dir = true; 139 create_dir = true;
140 break; 140 break;
141 case chrome::DIR_USER_DOCUMENTS: 141 case chrome::DIR_USER_DOCUMENTS:
142 if (!GetUserDocumentsDirectory(&cur)) 142 if (!GetUserDocumentsDirectory(&cur))
143 return false; 143 return false;
144 create_dir = true; 144 create_dir = true;
145 break; 145 break;
146 case chrome::DIR_DEFAULT_DOWNLOADS_SAFE: 146 case chrome::DIR_DEFAULT_DOWNLOADS_SAFE:
147 #if defined(OS_WIN) 147 #if defined(OS_WIN) || defined(OS_LINUX)
148 if (!GetUserDownloadsDirectorySafe(&cur)) 148 if (!GetUserDownloadsDirectorySafe(&cur))
149 return false; 149 return false;
150 break; 150 break;
151 #else 151 #else
152 // Fall through for all other platforms. 152 // Fall through for all other platforms.
153 #endif 153 #endif
154 case chrome::DIR_DEFAULT_DOWNLOADS: 154 case chrome::DIR_DEFAULT_DOWNLOADS:
155 if (!GetUserDownloadsDirectory(&cur)) 155 if (!GetUserDownloadsDirectory(&cur))
156 return false; 156 return false;
157 // Do not create the download directory here, we have done it twice now 157 // Do not create the download directory here, we have done it twice now
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 return true; 402 return true;
403 } 403 }
404 404
405 // This cannot be done as a static initializer sadly since Visual Studio will 405 // This cannot be done as a static initializer sadly since Visual Studio will
406 // eliminate this object file if there is no direct entry point into it. 406 // eliminate this object file if there is no direct entry point into it.
407 void RegisterPathProvider() { 407 void RegisterPathProvider() {
408 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 408 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
409 } 409 }
410 410
411 } // namespace chrome 411 } // 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