OLD | NEW |
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" | |
8 #include "base/file_util.h" | 7 #include "base/file_util.h" |
9 #include "base/logging.h" | 8 #include "base/logging.h" |
10 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
11 #include "base/path_service.h" | 10 #include "base/path_service.h" |
12 #include "base/string_util.h" | 11 #include "base/string_util.h" |
13 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
14 #include "base/version.h" | 13 #include "base/version.h" |
15 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
16 #include "chrome/common/chrome_paths_internal.h" | 15 #include "chrome/common/chrome_paths_internal.h" |
17 #include "chrome/common/chrome_switches.h" | |
18 | 16 |
19 #if defined(OS_MACOSX) | 17 #if defined(OS_MACOSX) |
20 #include "base/mac/mac_util.h" | 18 #include "base/mac/mac_util.h" |
21 #endif | 19 #endif |
22 | 20 |
23 namespace { | 21 namespace { |
24 | 22 |
25 // File name of the internal Flash plugin on different platforms. | 23 // File name of the internal Flash plugin on different platforms. |
26 const FilePath::CharType kInternalFlashPluginFileName[] = | 24 const FilePath::CharType kInternalFlashPluginFileName[] = |
27 #if defined(OS_MACOSX) | 25 #if defined(OS_MACOSX) |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 NOTREACHED(); | 146 NOTREACHED(); |
149 return false; | 147 return false; |
150 } | 148 } |
151 create_dir = true; | 149 create_dir = true; |
152 break; | 150 break; |
153 case chrome::DIR_USER_DOCUMENTS: | 151 case chrome::DIR_USER_DOCUMENTS: |
154 if (!GetUserDocumentsDirectory(&cur)) | 152 if (!GetUserDocumentsDirectory(&cur)) |
155 return false; | 153 return false; |
156 create_dir = true; | 154 create_dir = true; |
157 break; | 155 break; |
| 156 case chrome::DIR_USER_PICTURES: |
| 157 if (!GetUserPicturesDirectory(&cur)) |
| 158 return false; |
| 159 break; |
158 case chrome::DIR_DEFAULT_DOWNLOADS_SAFE: | 160 case chrome::DIR_DEFAULT_DOWNLOADS_SAFE: |
159 #if defined(OS_WIN) || defined(OS_LINUX) | 161 #if defined(OS_WIN) || defined(OS_LINUX) |
160 if (!GetUserDownloadsDirectorySafe(&cur)) | 162 if (!GetUserDownloadsDirectorySafe(&cur)) |
161 return false; | 163 return false; |
162 break; | 164 break; |
163 #else | 165 #else |
164 // Fall through for all other platforms. | 166 // Fall through for all other platforms. |
165 #endif | 167 #endif |
166 case chrome::DIR_DEFAULT_DOWNLOADS: | 168 case chrome::DIR_DEFAULT_DOWNLOADS: |
167 if (!GetUserDownloadsDirectory(&cur)) | 169 if (!GetUserDownloadsDirectory(&cur)) |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 return true; | 422 return true; |
421 } | 423 } |
422 | 424 |
423 // This cannot be done as a static initializer sadly since Visual Studio will | 425 // This cannot be done as a static initializer sadly since Visual Studio will |
424 // eliminate this object file if there is no direct entry point into it. | 426 // eliminate this object file if there is no direct entry point into it. |
425 void RegisterPathProvider() { | 427 void RegisterPathProvider() { |
426 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 428 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
427 } | 429 } |
428 | 430 |
429 } // namespace chrome | 431 } // namespace chrome |
OLD | NEW |