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

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

Issue 11031008: Upstreaming chrome/common/chrome_* diff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing Nishel's nits Created 8 years, 2 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_constants.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) 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/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/sys_info.h" 12 #include "base/sys_info.h"
13 #include "base/version.h" 13 #include "base/version.h"
14 #include "chrome/common/chrome_constants.h" 14 #include "chrome/common/chrome_constants.h"
15 #include "chrome/common/chrome_paths_internal.h" 15 #include "chrome/common/chrome_paths_internal.h"
16 #include "ui/base/ui_base_paths.h" 16 #include "ui/base/ui_base_paths.h"
17 17
18 #if defined(OS_ANDROID)
19 #include "base/android/path_utils.h"
20 #endif
21
18 #if defined(OS_MACOSX) 22 #if defined(OS_MACOSX)
19 #include "base/mac/mac_util.h" 23 #include "base/mac/mac_util.h"
20 #endif 24 #endif
21 25
22 namespace { 26 namespace {
23 27
24 // File name of the internal Flash plugin on different platforms. 28 // File name of the internal Flash plugin on different platforms.
25 const FilePath::CharType kInternalFlashPluginFileName[] = 29 const FilePath::CharType kInternalFlashPluginFileName[] =
26 #if defined(OS_MACOSX) 30 #if defined(OS_MACOSX)
27 FILE_PATH_LITERAL("Flash Player Plugin for Chrome.plugin"); 31 FILE_PATH_LITERAL("Flash Player Plugin for Chrome.plugin");
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 break; 185 break;
182 case chrome::DIR_DEFAULT_DOWNLOADS_SAFE: 186 case chrome::DIR_DEFAULT_DOWNLOADS_SAFE:
183 #if defined(OS_WIN) || defined(OS_LINUX) 187 #if defined(OS_WIN) || defined(OS_LINUX)
184 if (!GetUserDownloadsDirectorySafe(&cur)) 188 if (!GetUserDownloadsDirectorySafe(&cur))
185 return false; 189 return false;
186 break; 190 break;
187 #else 191 #else
188 // Fall through for all other platforms. 192 // Fall through for all other platforms.
189 #endif 193 #endif
190 case chrome::DIR_DEFAULT_DOWNLOADS: 194 case chrome::DIR_DEFAULT_DOWNLOADS:
195 #if defined(OS_ANDROID)
196 if (!base::android::GetDownloadsDirectory(&cur))
197 return false;
198 #else
191 if (!GetUserDownloadsDirectory(&cur)) 199 if (!GetUserDownloadsDirectory(&cur))
192 return false; 200 return false;
193 // Do not create the download directory here, we have done it twice now 201 // Do not create the download directory here, we have done it twice now
194 // and annoyed a lot of users. 202 // and annoyed a lot of users.
203 #endif
195 break; 204 break;
196 case chrome::DIR_CRASH_DUMPS: 205 case chrome::DIR_CRASH_DUMPS:
197 #if defined(OS_CHROMEOS) 206 #if defined(OS_CHROMEOS)
198 // ChromeOS uses a separate directory. See http://crosbug.com/25089 207 // ChromeOS uses a separate directory. See http://crosbug.com/25089
199 cur = FilePath("/var/log/chrome"); 208 cur = FilePath("/var/log/chrome");
209 #elif defined(OS_ANDROID)
210 if (!base::android::GetCacheDirectory(&cur))
211 return false;
200 #else 212 #else
201 // The crash reports are always stored relative to the default user data 213 // The crash reports are always stored relative to the default user data
202 // directory. This avoids the problem of having to re-initialize the 214 // directory. This avoids the problem of having to re-initialize the
203 // exception handler after parsing command line options, which may 215 // exception handler after parsing command line options, which may
204 // override the location of the app's profile directory. 216 // override the location of the app's profile directory.
205 if (!GetDefaultUserDataDirectory(&cur)) 217 if (!GetDefaultUserDataDirectory(&cur))
206 return false; 218 return false;
207 #endif 219 #endif
208 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); 220 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports"));
209 create_dir = true; 221 create_dir = true;
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 return true; 471 return true;
460 } 472 }
461 473
462 // This cannot be done as a static initializer sadly since Visual Studio will 474 // This cannot be done as a static initializer sadly since Visual Studio will
463 // eliminate this object file if there is no direct entry point into it. 475 // eliminate this object file if there is no direct entry point into it.
464 void RegisterPathProvider() { 476 void RegisterPathProvider() {
465 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 477 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
466 } 478 }
467 479
468 } // namespace chrome 480 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698