summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorhajimehoshi@chromium.org <hajimehoshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-22 13:08:50 +0000
committerhajimehoshi@chromium.org <hajimehoshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-22 13:08:50 +0000
commitf274d37d6b9dfa96d86e9abbc6852bba179c9161 (patch)
tree8a3740275928324203e1edb7510824124dbd4689 /chrome/common
parent535dd11d527944978a84c6bc8d367aa04793233e (diff)
downloadchromium_src-f274d37d6b9dfa96d86e9abbc6852bba179c9161.zip
chromium_src-f274d37d6b9dfa96d86e9abbc6852bba179c9161.tar.gz
chromium_src-f274d37d6b9dfa96d86e9abbc6852bba179c9161.tar.bz2
Translate: Refactoring: Reduce dependencies on CLD
TEST=browser_tests, unit_tests Review URL: https://chromiumcodereview.appspot.com/19286010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212880 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/DEPS1
-rw-r--r--chrome/common/translate/language_detection_util.cc9
-rw-r--r--chrome/common/translate/language_detection_util.h3
3 files changed, 13 insertions, 0 deletions
diff --git a/chrome/common/DEPS b/chrome/common/DEPS
index 81bafdb..7101165 100644
--- a/chrome/common/DEPS
+++ b/chrome/common/DEPS
@@ -23,6 +23,7 @@ include_rules = [
# Other libraries.
"+chrome/third_party/xdg_user_dirs",
"+third_party/bzip2",
+ "+third_party/cld",
"+third_party/cld/encodings/compact_lang_det/win",
"+third_party/mt19937ar",
"+third_party/npapi",
diff --git a/chrome/common/translate/language_detection_util.cc b/chrome/common/translate/language_detection_util.cc
index a0c062b..a834f97 100644
--- a/chrome/common/translate/language_detection_util.cc
+++ b/chrome/common/translate/language_detection_util.cc
@@ -13,6 +13,7 @@
#include "chrome/common/translate/translate_util.h"
#if defined(ENABLE_LANGUAGE_DETECTION)
+#include "third_party/cld/encodings/compact_lang_det/compact_lang_det.h"
#include "third_party/cld/encodings/compact_lang_det/win/cld_unicodetext.h"
#endif
@@ -301,4 +302,12 @@ bool MaybeServerWrongConfiguration(const std::string& page_language,
return false;
}
+std::string GetCLDVersion() {
+#if defined(ENABLE_LANGUAGE_DETECTION)
+ return CompactLangDet::DetectLanguageVersion();
+#else
+ return ""
+#endif
+}
+
} // namespace LanguageDetectionUtil
diff --git a/chrome/common/translate/language_detection_util.h b/chrome/common/translate/language_detection_util.h
index 787c0781..4962b45 100644
--- a/chrome/common/translate/language_detection_util.h
+++ b/chrome/common/translate/language_detection_util.h
@@ -39,6 +39,9 @@ bool IsSameOrSimilarLanguages(const std::string& page_language,
bool MaybeServerWrongConfiguration(const std::string& page_language,
const std::string& cld_language);
+// Returns the version string of CLD.
+std::string GetCLDVersion();
+
} // namespace LanguageDetectionUtil
#endif // CHROME_COMMON_TRANSLATE_LANGUAGE_DETECTION_UTIL_H_