Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Side by Side Diff: components/translate/language_detection/language_detection_util.h

Issue 25531002: Move language detection to a component (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Run translate unittests on iOS Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_COMMON_TRANSLATE_LANGUAGE_DETECTION_UTIL_H_ 5 #ifndef COMPONENTS_TRANSLATE_LANGUAGE_DETECTION_LANGUAGE_DETECTION_UTIL_H_
6 #define CHROME_COMMON_TRANSLATE_LANGUAGE_DETECTION_UTIL_H_ 6 #define COMPONENTS_TRANSLATE_LANGUAGE_DETECTION_LANGUAGE_DETECTION_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 11
12 namespace LanguageDetectionUtil { 12 namespace translate {
13 13
14 // Determines content page language from Content-Language code and contents. 14 // Determines content page language from Content-Language code and contents.
15 std::string DeterminePageLanguage(const std::string& code, 15 std::string DeterminePageLanguage(const std::string& code,
16 const std::string& html_lang, 16 const std::string& html_lang,
17 const base::string16& contents, 17 const base::string16& contents,
18 std::string* cld_language, 18 std::string* cld_language,
19 bool* is_cld_reliable); 19 bool* is_cld_reliable);
20 20
21 // Corrects language code if it contains well-known mistakes. 21 // Corrects language code if it contains well-known mistakes.
22 // Called only by tests. 22 // Called only by tests.
(...skipping 12 matching lines...) Expand all
35 35
36 // Checks if languages pair is one of well-known pairs of wrong server 36 // Checks if languages pair is one of well-known pairs of wrong server
37 // configuration. 37 // configuration.
38 // Called only by tests. 38 // Called only by tests.
39 bool MaybeServerWrongConfiguration(const std::string& page_language, 39 bool MaybeServerWrongConfiguration(const std::string& page_language,
40 const std::string& cld_language); 40 const std::string& cld_language);
41 41
42 // Returns the version string of CLD. 42 // Returns the version string of CLD.
43 std::string GetCLDVersion(); 43 std::string GetCLDVersion();
44 44
45 } // namespace LanguageDetectionUtil 45 } // namespace translate
46 46
47 #endif // CHROME_COMMON_TRANSLATE_LANGUAGE_DETECTION_UTIL_H_ 47 #endif // COMPONENTS_TRANSLATE_LANGUAGE_DETECTION_LANGUAGE_DETECTION_UTIL_H_
OLDNEW
« no previous file with comments | « components/translate/language_detection/DEPS ('k') | components/translate/language_detection/language_detection_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698