Commit d498bd8a authored by evliu's avatar evliu Committed by Commit Bot

Update the SODA component to be platform-specific.

This CL updates the SODA component to be platform-specific.

Bug: 1033227
Change-Id: I41bd61affc673b38d6029c83a3b7468121dc8c79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2348015Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Evan Liu <evliu@google.com>
Cr-Commit-Position: refs/heads/master@{#797361}
parent ae752b76
...@@ -36,9 +36,6 @@ static_assert(base::size(kSODAPublicKeySHA256) == crypto::kSHA256Length, ...@@ -36,9 +36,6 @@ static_assert(base::size(kSODAPublicKeySHA256) == crypto::kSHA256Length,
const char kSODAManifestName[] = "SODA Library"; const char kSODAManifestName[] = "SODA Library";
constexpr base::FilePath::CharType kSodaBinaryRelativePath[] =
FILE_PATH_LITERAL("SODAFiles/libsoda.so");
constexpr base::FilePath::CharType kSodaEnUsConfigFileRelativePath[] = constexpr base::FilePath::CharType kSodaEnUsConfigFileRelativePath[] =
FILE_PATH_LITERAL("SODAFiles/en_us/dictation.ascii_proto"); FILE_PATH_LITERAL("SODAFiles/en_us/dictation.ascii_proto");
...@@ -129,7 +126,7 @@ void UpdateSODAInstallDirPref(PrefService* prefs, ...@@ -129,7 +126,7 @@ void UpdateSODAInstallDirPref(PrefService* prefs,
const base::FilePath& install_dir) { const base::FilePath& install_dir) {
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
prefs->SetFilePath(prefs::kSodaBinaryPath, prefs->SetFilePath(prefs::kSodaBinaryPath,
install_dir.Append(kSodaBinaryRelativePath)); install_dir.Append(speech::kSodaBinaryRelativePath));
prefs->SetFilePath(prefs::kSodaEnUsConfigPath, prefs->SetFilePath(prefs::kSodaEnUsConfigPath,
install_dir.Append(kSodaEnUsConfigFileRelativePath)); install_dir.Append(kSodaEnUsConfigFileRelativePath));
#endif #endif
......
...@@ -11,14 +11,16 @@ ...@@ -11,14 +11,16 @@
namespace speech { namespace speech {
constexpr base::FilePath::CharType kSodaInstallationRelativePath[] = #ifdef OS_WIN
FILE_PATH_LITERAL("SODA"); constexpr base::FilePath::CharType kSodaBinaryRelativePath[] =
FILE_PATH_LITERAL("SODAFiles/SODA.dll");
#else
constexpr base::FilePath::CharType kSodaBinaryRelativePath[] = constexpr base::FilePath::CharType kSodaBinaryRelativePath[] =
FILE_PATH_LITERAL("SODAFiles/libsoda.so"); FILE_PATH_LITERAL("SODAFiles/libsoda.so");
#endif
constexpr base::FilePath::CharType kSodaEnUsConfigFileRelativePath[] = constexpr base::FilePath::CharType kSodaInstallationRelativePath[] =
FILE_PATH_LITERAL("SODAFiles/en_us/dictation.ascii_proto"); FILE_PATH_LITERAL("SODA");
const base::FilePath GetSodaDirectory() { const base::FilePath GetSodaDirectory() {
base::FilePath components_dir; base::FilePath components_dir;
...@@ -49,10 +51,4 @@ const base::FilePath GetSodaBinaryPath() { ...@@ -49,10 +51,4 @@ const base::FilePath GetSodaBinaryPath() {
: soda_dir.Append(kSodaBinaryRelativePath); : soda_dir.Append(kSodaBinaryRelativePath);
} }
const base::FilePath GetSodaConfigPath() {
base::FilePath soda_dir = GetLatestSodaDirectory();
return soda_dir.empty() ? base::FilePath()
: soda_dir.Append(kSodaEnUsConfigFileRelativePath);
}
} // namespace speech } // namespace speech
...@@ -33,10 +33,6 @@ const base::FilePath GetLatestSodaDirectory(); ...@@ -33,10 +33,6 @@ const base::FilePath GetLatestSodaDirectory();
// installed. // installed.
const base::FilePath GetSodaBinaryPath(); const base::FilePath GetSodaBinaryPath();
// Get the path to the dictation.ascii_proto config file used by SODA. Returns
// an empty path if SODA is not installed.
const base::FilePath GetSodaConfigPath();
} // namespace speech } // namespace speech
#endif // COMPONENTS_SODA_CONSTANTS_H_ #endif // COMPONENTS_SODA_CONSTANTS_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment