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/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 FILE_PATH_LITERAL("gcswf32.dll"); | 39 FILE_PATH_LITERAL("gcswf32.dll"); |
40 #else // OS_LINUX, etc. | 40 #else // OS_LINUX, etc. |
41 FILE_PATH_LITERAL("libgcflashplayer.so"); | 41 FILE_PATH_LITERAL("libgcflashplayer.so"); |
42 #endif | 42 #endif |
43 | 43 |
44 // The Pepper Flash plugins are in a directory with this name. | 44 // The Pepper Flash plugins are in a directory with this name. |
45 const base::FilePath::CharType kPepperFlashBaseDirectory[] = | 45 const base::FilePath::CharType kPepperFlashBaseDirectory[] = |
46 FILE_PATH_LITERAL("PepperFlash"); | 46 FILE_PATH_LITERAL("PepperFlash"); |
47 | 47 |
48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
49 const base::FilePath::CharType kPepperFlashDebuggerBaseDirectory[] = | 49 const base::FilePath::CharType kPepperFlashSystemBaseDirectory[] = |
50 FILE_PATH_LITERAL("Macromed\\Flash"); | 50 FILE_PATH_LITERAL("Macromed\\Flash"); |
| 51 #elif defined(OS_MACOSX) |
| 52 const base::FilePath::CharType kPepperFlashSystemBaseDirectory[] = |
| 53 FILE_PATH_LITERAL("Internet Plug-Ins/PepperFlashPlayer"); |
51 #endif | 54 #endif |
52 | 55 |
53 // File name of the internal PDF plugin on different platforms. | 56 // File name of the internal PDF plugin on different platforms. |
54 const base::FilePath::CharType kInternalPDFPluginFileName[] = | 57 const base::FilePath::CharType kInternalPDFPluginFileName[] = |
55 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
56 FILE_PATH_LITERAL("pdf.dll"); | 59 FILE_PATH_LITERAL("pdf.dll"); |
57 #elif defined(OS_MACOSX) | 60 #elif defined(OS_MACOSX) |
58 FILE_PATH_LITERAL("PDF.plugin"); | 61 FILE_PATH_LITERAL("PDF.plugin"); |
59 #else // Linux and Chrome OS | 62 #else // Linux and Chrome OS |
60 FILE_PATH_LITERAL("libpdf.so"); | 63 FILE_PATH_LITERAL("libpdf.so"); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 case chrome::DIR_PEPPER_FLASH_PLUGIN: | 257 case chrome::DIR_PEPPER_FLASH_PLUGIN: |
255 if (!GetInternalPluginsDirectory(&cur)) | 258 if (!GetInternalPluginsDirectory(&cur)) |
256 return false; | 259 return false; |
257 cur = cur.Append(kPepperFlashBaseDirectory); | 260 cur = cur.Append(kPepperFlashBaseDirectory); |
258 break; | 261 break; |
259 case chrome::DIR_COMPONENT_UPDATED_PEPPER_FLASH_PLUGIN: | 262 case chrome::DIR_COMPONENT_UPDATED_PEPPER_FLASH_PLUGIN: |
260 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 263 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
261 return false; | 264 return false; |
262 cur = cur.Append(kPepperFlashBaseDirectory); | 265 cur = cur.Append(kPepperFlashBaseDirectory); |
263 break; | 266 break; |
264 case chrome::DIR_PEPPER_FLASH_DEBUGGER_PLUGIN: | 267 case chrome::DIR_PEPPER_FLASH_SYSTEM_PLUGIN: |
265 #if defined(OS_WIN) | 268 #if defined(OS_WIN) |
266 if (!PathService::Get(base::DIR_SYSTEM, &cur)) | 269 if (!PathService::Get(base::DIR_SYSTEM, &cur)) |
267 return false; | 270 return false; |
268 cur = cur.Append(kPepperFlashDebuggerBaseDirectory); | 271 cur = cur.Append(kPepperFlashSystemBaseDirectory); |
269 #elif defined(OS_MACOSX) | 272 #elif defined(OS_MACOSX) |
270 // TODO(luken): finalize Mac OS directory paths, current consensus is | 273 if (!GetLocalLibraryDirectory(&cur)) |
271 // around /Library/Internet Plug-Ins/PepperFlashPlayer/ | 274 return false; |
272 return false; | 275 cur = cur.Append(kPepperFlashSystemBaseDirectory); |
273 #else | 276 #else |
| 277 // TODO(wfh): If Adobe release PPAPI binaries for Linux, add support here. |
274 return false; | 278 return false; |
275 #endif | 279 #endif |
276 break; | 280 break; |
277 case chrome::FILE_LOCAL_STATE: | 281 case chrome::FILE_LOCAL_STATE: |
278 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 282 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
279 return false; | 283 return false; |
280 cur = cur.Append(chrome::kLocalStateFilename); | 284 cur = cur.Append(chrome::kLocalStateFilename); |
281 break; | 285 break; |
282 case chrome::FILE_RECORDED_SCRIPT: | 286 case chrome::FILE_RECORDED_SCRIPT: |
283 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 287 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 | 591 |
588 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 592 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
589 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 593 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
590 } | 594 } |
591 | 595 |
592 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 596 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
593 return g_invalid_specified_user_data_dir.Get(); | 597 return g_invalid_specified_user_data_dir.Get(); |
594 } | 598 } |
595 | 599 |
596 } // namespace chrome | 600 } // namespace chrome |
OLD | NEW |