Index: chrome/browser/extensions/api/i18n/i18n_api.h |
diff --git a/chrome/browser/extensions/api/i18n/i18n_api.h b/chrome/browser/extensions/api/i18n/i18n_api.h |
index 5863aaacf22c42625d43467e99cc5928bb968db7..8d37b0f03387570131f5154ca1180375a97c9375 100644 |
--- a/chrome/browser/extensions/api/i18n/i18n_api.h |
+++ b/chrome/browser/extensions/api/i18n/i18n_api.h |
@@ -5,8 +5,13 @@ |
#ifndef CHROME_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_ |
#define CHROME_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_ |
+#include "base/strings/string16.h" |
+#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/extensions/chrome_extension_function.h" |
#include "extensions/browser/browser_context_keyed_api_factory.h" |
+// Added |
Takashi Toyoshima
2015/07/08 03:19:41
remove this comment line
amalika
2015/07/08 21:58:03
Done.
|
+#include "third_party/cld_2/src/public/compact_lang_det.h" |
+#include "third_party/cld_2/src/public/encodings.h" |
class Profile; |
@@ -18,6 +23,24 @@ class I18nGetAcceptLanguagesFunction : public ChromeSyncExtensionFunction { |
DECLARE_EXTENSION_FUNCTION("i18n.getAcceptLanguages", I18N_GETACCEPTLANGUAGES) |
}; |
+typedef struct { |
Takashi Toyoshima
2015/07/08 03:19:41
I think 'typedef struct { ... }' is not famous in
amalika
2015/07/08 21:58:03
Done.
Takashi Toyoshima
2015/07/09 03:32:34
Not yet.
struct DetectedLanguage {
std::string
|
+ std::string language; |
+ int percentage; |
+} DetectedLanguage; |
+ |
+class I18nDetectLanguageFunction : public ChromeAsyncExtensionFunction { |
+ private: |
Takashi Toyoshima
2015/07/08 03:19:41
wrong indent.
It would be useful to try 'git cl fo
amalika
2015/07/08 21:58:03
Done.
|
+ ~I18nDetectLanguageFunction() override {}; |
+ bool RunAsync() override; |
+ void GetLanguage(const std::string& text); |
+ void SendLanguagesResult(DetectedLanguage *detected_langs, |
+ const bool is_reliable); |
+ void InitDetectedLanguages(CLD2::Language *langs, int *percent3, |
+ DetectedLanguage detected_langs[3]); |
+ |
+ DECLARE_EXTENSION_FUNCTION("i18n.detectLanguage", I18N_DETECTLANGUAGE) |
+}; |
+ |
} // namespace extensions |
-#endif // CHROME_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_ |
+#endif // CHROME_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_ |