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

Side by Side Diff: chrome/browser/extensions/api/i18n/i18n_api.h

Issue 1244343002: Revert of New thin layer of API extension chrome.i18n.detectLanguage (patchset #11 id:300001 of htt… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do revert histograms.xml. Apparently it is OK if it's only been a few hours. Created 5 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_
7 7
8 #include <string>
9 #include <vector>
10
11 #include "chrome/browser/extensions/chrome_extension_function.h" 8 #include "chrome/browser/extensions/chrome_extension_function.h"
12 #include "chrome/common/extensions/api/i18n.h"
13 #include "extensions/browser/browser_context_keyed_api_factory.h" 9 #include "extensions/browser/browser_context_keyed_api_factory.h"
14 #include "extensions/browser/extension_function.h"
15 #include "third_party/cld_2/src/public/compact_lang_det.h"
16 #include "third_party/cld_2/src/public/encodings.h"
17 10
18 class Profile; 11 class Profile;
19 12
20 namespace extensions { 13 namespace extensions {
21 14
22 class I18nGetAcceptLanguagesFunction : public ChromeSyncExtensionFunction { 15 class I18nGetAcceptLanguagesFunction : public ChromeSyncExtensionFunction {
23 ~I18nGetAcceptLanguagesFunction() override {} 16 ~I18nGetAcceptLanguagesFunction() override {}
24 bool RunSync() override; 17 bool RunSync() override;
25 DECLARE_EXTENSION_FUNCTION("i18n.getAcceptLanguages", I18N_GETACCEPTLANGUAGES) 18 DECLARE_EXTENSION_FUNCTION("i18n.getAcceptLanguages", I18N_GETACCEPTLANGUAGES)
26 }; 19 };
27 20
28 class I18nDetectLanguageFunction : public UIThreadExtensionFunction {
29 private:
30 ~I18nDetectLanguageFunction() override{};
31
32 // UIThreadExtensionFunction:
33 ResponseAction Run() override;
34
35 scoped_ptr<base::ListValue> GetLanguage(const std::string& text);
36 void InitDetectedLanguages(
37 CLD2::Language* langs,
38 int* percent3,
39 std::vector<linked_ptr<
40 api::i18n::DetectLanguage::Results::Result::LanguagesType>>*
41 detected_langs);
42
43 DECLARE_EXTENSION_FUNCTION("i18n.detectLanguage", I18N_DETECTLANGUAGE)
44 };
45
46 } // namespace extensions 21 } // namespace extensions
47 22
48 #endif // CHROME_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_ 23 #endif // CHROME_BROWSER_EXTENSIONS_API_I18N_I18N_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/api_registration.gyp ('k') | chrome/browser/extensions/api/i18n/i18n_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698