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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 270 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
271 return false; | 271 return false; |
272 cur = cur.Append(chrome::kLocalStateFilename); | 272 cur = cur.Append(chrome::kLocalStateFilename); |
273 break; | 273 break; |
274 case chrome::FILE_RECORDED_SCRIPT: | 274 case chrome::FILE_RECORDED_SCRIPT: |
275 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 275 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
276 return false; | 276 return false; |
277 cur = cur.Append(FILE_PATH_LITERAL("script.log")); | 277 cur = cur.Append(FILE_PATH_LITERAL("script.log")); |
278 break; | 278 break; |
279 case chrome::FILE_FLASH_PLUGIN: | 279 case chrome::FILE_FLASH_PLUGIN: |
280 case chrome::FILE_FLASH_PLUGIN_EXISTING: | |
281 if (!GetInternalPluginsDirectory(&cur)) | 280 if (!GetInternalPluginsDirectory(&cur)) |
282 return false; | 281 return false; |
283 cur = cur.Append(kInternalFlashPluginFileName); | 282 cur = cur.Append(kInternalFlashPluginFileName); |
284 if (key == chrome::FILE_FLASH_PLUGIN_EXISTING && | |
285 !file_util::PathExists(cur)) | |
286 return false; | |
287 break; | 283 break; |
288 case chrome::FILE_PEPPER_FLASH_PLUGIN: | 284 case chrome::FILE_PEPPER_FLASH_PLUGIN: |
289 if (!PathService::Get(chrome::DIR_PEPPER_FLASH_PLUGIN, &cur)) | 285 if (!PathService::Get(chrome::DIR_PEPPER_FLASH_PLUGIN, &cur)) |
290 return false; | 286 return false; |
291 cur = cur.Append(chrome::kPepperFlashPluginFilename); | 287 cur = cur.Append(chrome::kPepperFlashPluginFilename); |
292 break; | 288 break; |
293 case chrome::FILE_PDF_PLUGIN: | 289 case chrome::FILE_PDF_PLUGIN: |
294 if (!GetInternalPluginsDirectory(&cur)) | 290 if (!GetInternalPluginsDirectory(&cur)) |
295 return false; | 291 return false; |
296 cur = cur.Append(kInternalPDFPluginFileName); | 292 cur = cur.Append(kInternalPDFPluginFileName); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 return true; | 500 return true; |
505 } | 501 } |
506 | 502 |
507 // This cannot be done as a static initializer sadly since Visual Studio will | 503 // This cannot be done as a static initializer sadly since Visual Studio will |
508 // eliminate this object file if there is no direct entry point into it. | 504 // eliminate this object file if there is no direct entry point into it. |
509 void RegisterPathProvider() { | 505 void RegisterPathProvider() { |
510 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 506 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
511 } | 507 } |
512 | 508 |
513 } // namespace chrome | 509 } // namespace chrome |
OLD | NEW |