Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / common / chrome_paths.cc
index d34e247..8a205a6 100644 (file)
@@ -4,7 +4,7 @@
 
 #include "chrome/common/chrome_paths.h"
 
-#include "base/file_util.h"
+#include "base/files/file_util.h"
 #include "base/lazy_instance.h"
 #include "base/logging.h"
 #include "base/mac/bundle_locations.h"
@@ -20,6 +20,7 @@
 
 #if defined(OS_ANDROID)
 #include "base/android/path_utils.h"
+#include "base/base_paths_android.h"
 #endif
 
 #if defined(OS_MACOSX)
@@ -44,6 +45,11 @@ const base::FilePath::CharType kInternalFlashPluginFileName[] =
 const base::FilePath::CharType kPepperFlashBaseDirectory[] =
     FILE_PATH_LITERAL("PepperFlash");
 
+#if defined(OS_WIN)
+const base::FilePath::CharType kPepperFlashDebuggerBaseDirectory[] =
+    FILE_PATH_LITERAL("Macromed\\Flash");
+#endif
+
 // File name of the internal PDF plugin on different platforms.
 const base::FilePath::CharType kInternalPDFPluginFileName[] =
 #if defined(OS_WIN)
@@ -54,16 +60,8 @@ const base::FilePath::CharType kInternalPDFPluginFileName[] =
     FILE_PATH_LITERAL("libpdf.so");
 #endif
 
-// File name of the internal NaCl plugin on different platforms.
 const base::FilePath::CharType kInternalNaClPluginFileName[] =
-#if defined(OS_WIN)
-    FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.dll");
-#elif defined(OS_MACOSX)
-    // TODO(noelallen) Please verify this extention name is correct.
-    FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.plugin");
-#else  // Linux and Chrome OS
-    FILE_PATH_LITERAL("libppGoogleNaClPluginChrome.so");
-#endif
+    FILE_PATH_LITERAL("internal-nacl-plugin");
 
 const base::FilePath::CharType kEffectsPluginFileName[] =
 #if defined(OS_WIN)
@@ -263,6 +261,19 @@ bool PathProvider(int key, base::FilePath* result) {
         return false;
       cur = cur.Append(kPepperFlashBaseDirectory);
       break;
+    case chrome::DIR_PEPPER_FLASH_DEBUGGER_PLUGIN:
+#if defined(OS_WIN)
+      if (!PathService::Get(base::DIR_SYSTEM, &cur))
+        return false;
+      cur = cur.Append(kPepperFlashDebuggerBaseDirectory);
+#elif defined(OS_MACOSX)
+      // TODO(luken): finalize Mac OS directory paths, current consensus is
+      // around /Library/Internet Plug-Ins/PepperFlashPlayer/
+      return false;
+#else
+      return false;
+#endif
+      break;
     case chrome::FILE_LOCAL_STATE:
       if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
         return false;
@@ -293,6 +304,9 @@ bool PathProvider(int key, base::FilePath* result) {
         return false;
       cur = cur.Append(kEffectsPluginFileName);
       break;
+    // TODO(teravest): Remove this case once the internal NaCl plugin is gone.
+    // We currently need a path here to look up whether the plugin is disabled
+    // and what its permissions are.
     case chrome::FILE_NACL_PLUGIN:
       if (!GetInternalPluginsDirectory(&cur))
         return false;
@@ -406,7 +420,7 @@ bool PathProvider(int key, base::FilePath* result) {
       break;
 #endif
 #if defined(OS_LINUX) && defined(ENABLE_MANAGED_USERS)
-    case chrome::DIR_MANAGED_USERS_DEFAULT_APPS:
+    case chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS:
       if (!PathService::Get(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS, &cur))
         return false;
       cur = cur.Append(FILE_PATH_LITERAL("managed_users"));
@@ -416,8 +430,15 @@ bool PathProvider(int key, base::FilePath* result) {
     // will fail if executed from an installed executable (because the
     // generated path won't exist).
     case chrome::DIR_GEN_TEST_DATA:
+#if defined(OS_ANDROID)
+      // On Android, our tests don't have permission to write to DIR_MODULE.
+      // gtest/test_runner.py pushes data to external storage.
+      if (!PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &cur))
+        return false;
+#else
       if (!PathService::Get(base::DIR_MODULE, &cur))
         return false;
+#endif
       cur = cur.Append(FILE_PATH_LITERAL("test_data"));
       if (!base::PathExists(cur))  // We don't want to create this.
         return false;
@@ -463,6 +484,20 @@ bool PathProvider(int key, base::FilePath* result) {
         return false;
       break;
     }
+    case chrome::DIR_USER_LIBRARY: {
+      if (!GetUserLibraryDirectory(&cur))
+        return false;
+      if (!base::PathExists(cur))  // We don't want to create this.
+        return false;
+      break;
+    }
+    case chrome::DIR_USER_APPLICATIONS: {
+      if (!GetUserApplicationsDirectory(&cur))
+        return false;
+      if (!base::PathExists(cur))  // We don't want to create this.
+        return false;
+      break;
+    }
 #endif
 #if defined(OS_CHROMEOS) || (defined(OS_MACOSX) && !defined(OS_IOS))
     case chrome::DIR_USER_EXTERNAL_EXTENSIONS: {
@@ -534,6 +569,13 @@ bool PathProvider(int key, base::FilePath* result) {
       cur = cur.Append(FILE_PATH_LITERAL("NativeMessagingHosts"));
       break;
 #endif  // defined(OS_LINUX) || (defined(OS_MACOSX) && !defined(OS_IOS))
+#if !defined(OS_ANDROID)
+    case chrome::DIR_GLOBAL_GCM_STORE:
+      if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
+        return false;
+      cur = cur.Append(kGCMStoreDirname);
+      break;
+#endif  // !defined(OS_ANDROID)
 
     default:
       return false;