| 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/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" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 FilePath cur; | 142 FilePath cur; |
| 143 switch (key) { | 143 switch (key) { |
| 144 case chrome::DIR_USER_DATA: | 144 case chrome::DIR_USER_DATA: |
| 145 if (!GetDefaultUserDataDirectory(&cur)) { | 145 if (!GetDefaultUserDataDirectory(&cur)) { |
| 146 NOTREACHED(); | 146 NOTREACHED(); |
| 147 return false; | 147 return false; |
| 148 } | 148 } |
| 149 create_dir = true; | 149 create_dir = true; |
| 150 break; | 150 break; |
| 151 #if defined(OS_WIN) |
| 152 case chrome::DIR_ALT_USER_DATA: |
| 153 if (!GetAlternateUserDataDirectory(&cur)) { |
| 154 NOTREACHED(); |
| 155 return false; |
| 156 } |
| 157 create_dir = false; |
| 158 break; |
| 159 #endif // OS_WIN |
| 151 case chrome::DIR_USER_DOCUMENTS: | 160 case chrome::DIR_USER_DOCUMENTS: |
| 152 if (!GetUserDocumentsDirectory(&cur)) | 161 if (!GetUserDocumentsDirectory(&cur)) |
| 153 return false; | 162 return false; |
| 154 create_dir = true; | 163 create_dir = true; |
| 155 break; | 164 break; |
| 156 case chrome::DIR_USER_PICTURES: | 165 case chrome::DIR_USER_PICTURES: |
| 157 if (!GetUserPicturesDirectory(&cur)) | 166 if (!GetUserPicturesDirectory(&cur)) |
| 158 return false; | 167 return false; |
| 159 break; | 168 break; |
| 160 case chrome::DIR_DEFAULT_DOWNLOADS_SAFE: | 169 case chrome::DIR_DEFAULT_DOWNLOADS_SAFE: |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 return true; | 437 return true; |
| 429 } | 438 } |
| 430 | 439 |
| 431 // This cannot be done as a static initializer sadly since Visual Studio will | 440 // This cannot be done as a static initializer sadly since Visual Studio will |
| 432 // eliminate this object file if there is no direct entry point into it. | 441 // eliminate this object file if there is no direct entry point into it. |
| 433 void RegisterPathProvider() { | 442 void RegisterPathProvider() { |
| 434 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 443 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 435 } | 444 } |
| 436 | 445 |
| 437 } // namespace chrome | 446 } // namespace chrome |
| OLD | NEW |