| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 cur = cur.Append(FILE_PATH_LITERAL("Managed Preferences")); | 313 cur = cur.Append(FILE_PATH_LITERAL("Managed Preferences")); |
| 314 char* login = getlogin(); | 314 char* login = getlogin(); |
| 315 if (!login) | 315 if (!login) |
| 316 return false; | 316 return false; |
| 317 cur = cur.AppendASCII(login); | 317 cur = cur.AppendASCII(login); |
| 318 if (!file_util::PathExists(cur)) // we don't want to create this | 318 if (!file_util::PathExists(cur)) // we don't want to create this |
| 319 return false; | 319 return false; |
| 320 break; | 320 break; |
| 321 } | 321 } |
| 322 #endif | 322 #endif |
| 323 #if defined(OS_CHROMEOS) |
| 324 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { |
| 325 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 326 return false; |
| 327 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); |
| 328 break; |
| 329 } |
| 330 #endif |
| 323 default: | 331 default: |
| 324 return false; | 332 return false; |
| 325 } | 333 } |
| 326 | 334 |
| 327 if (create_dir && !file_util::PathExists(cur) && | 335 if (create_dir && !file_util::PathExists(cur) && |
| 328 !file_util::CreateDirectory(cur)) | 336 !file_util::CreateDirectory(cur)) |
| 329 return false; | 337 return false; |
| 330 | 338 |
| 331 *result = cur; | 339 *result = cur; |
| 332 return true; | 340 return true; |
| 333 } | 341 } |
| 334 | 342 |
| 335 // This cannot be done as a static initializer sadly since Visual Studio will | 343 // This cannot be done as a static initializer sadly since Visual Studio will |
| 336 // eliminate this object file if there is no direct entry point into it. | 344 // eliminate this object file if there is no direct entry point into it. |
| 337 void RegisterPathProvider() { | 345 void RegisterPathProvider() { |
| 338 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 346 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 339 } | 347 } |
| 340 | 348 |
| 341 } // namespace chrome | 349 } // namespace chrome |
| OLD | NEW |