diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-13 10:16:32 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-14 10:43:10 +0200 |
commit | 939d104cc5a8208a0bef94ca14889ccd584a3526 (patch) | |
tree | 4d89c122ad5014a32cd8d4fbad6b7418944d2fb6 /src/core/content_client_qt.cpp | |
parent | 5a7063154520544fe19bb57af3609afef898bffb (diff) | |
parent | 6c2a111f8c82b56388abf409a61a3e0d56a52156 (diff) |
Merge branch '5.7' into dev
Change-Id: I1ecb615b8df1303c27b6609970502920123b3610
Diffstat (limited to 'src/core/content_client_qt.cpp')
-rw-r--r-- | src/core/content_client_qt.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp index 158bb0895..49c018b23 100644 --- a/src/core/content_client_qt.cpp +++ b/src/core/content_client_qt.cpp @@ -57,6 +57,18 @@ #include <QLibraryInfo> #include <QString> +#if defined(Q_OS_WIN) +#include <shlobj.h> +static QString getLocalAppDataDir() +{ + QString result; + wchar_t path[MAX_PATH]; + if (SHGetSpecialFolderPath(0, path, CSIDL_LOCAL_APPDATA, FALSE)) + result = QDir::fromNativeSeparators(QString::fromWCharArray(path)); + return result; +} +#endif + #if defined(ENABLE_PLUGINS) // The plugin logic is based on chrome/common/chrome_content_client.cc: @@ -199,10 +211,24 @@ void AddPepperWidevine(std::vector<content::PepperPluginInfo>* plugins) pluginPaths << potentialWidevinePluginPath; } } +#elif defined(Q_OS_WIN) + QDir potentialWidevineDir(getLocalAppDataDir() + "/Google/Chrome/User Data/WidevineCDM"); + if (potentialWidevineDir.exists()) { + QFileInfoList widevineVersionDirs = potentialWidevineDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed); + for (int i = 0; i < widevineVersionDirs.size(); ++i) { + QString versionDirPath(widevineVersionDirs.at(i).absoluteFilePath()); +#ifdef WIN64 + QString potentialWidevinePluginPath = versionDirPath + "/_platform_specific/win_x64/" + QString::fromLatin1(kWidevineCdmAdapterFileName); +#else + QString potentialWidevinePluginPath = versionDirPath + "/_platform_specific/win_x86/" + QString::fromLatin1(kWidevineCdmAdapterFileName); #endif -#if defined(Q_OS_LINUX) + pluginPaths << potentialWidevinePluginPath; + } + } +#elif defined(Q_OS_LINUX) pluginPaths << QStringLiteral("/opt/google/chrome/libwidevinecdmadapter.so") // Google Chrome - << QStringLiteral("/usr/lib/chromium/libwidevinecdmadapter.so"); // Arch + << QStringLiteral("/usr/lib/chromium/libwidevinecdmadapter.so") // Arch + << QStringLiteral("/usr/lib64/chromium/libwidevinecdmadapter.so"); // OpenSUSE style #endif } |