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

Side by Side Diff: ios/web_view/internal/translate/criwv_translate_ranker_factory.h

Issue 2565873002: [translate] Add translate ranker model loader. (Closed)
Patch Set: comments from asanka and hamelphi Created 3 years, 10 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IOS_WEB_VIEW_INTERNAL_TRANSLATE_CRIWV_TRANSLATE_RANKER_FACTORY_H_
6 #define IOS_WEB_VIEW_INTERNAL_TRANSLATE_CRIWV_TRANSLATE_RANKER_FACTORY_H_
7
8 #include <memory>
9 #include "base/macros.h"
10 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
11
12 namespace base {
13 template <typename T>
14 struct DefaultSingletonTraits;
15 } // namespace base
16
17 namespace translate {
18 class TranslateRanker;
19 }
20
21 namespace ios_web_view {
22
23 class CRIWVBrowserState;
24
25 // TranslateRankerFactory is a way to associate a
26 // TranslateRanker instance to a BrowserState.
27 class CRIWVTranslateRankerFactory : public BrowserStateKeyedServiceFactory {
28 public:
29 static translate::TranslateRanker* GetForBrowserState(
30 CRIWVBrowserState* browser_state);
31 static CRIWVTranslateRankerFactory* GetInstance();
32
33 private:
34 friend struct base::DefaultSingletonTraits<CRIWVTranslateRankerFactory>;
35
36 CRIWVTranslateRankerFactory();
37 ~CRIWVTranslateRankerFactory() override;
38
39 // BrowserStateKeyedServiceFactory implementation.
40 std::unique_ptr<KeyedService> BuildServiceInstanceFor(
41 web::BrowserState* context) const override;
42
43 DISALLOW_COPY_AND_ASSIGN(CRIWVTranslateRankerFactory);
44 };
45
46 } // namespace ios_web_view
47
48 #endif // IOS_WEB_VIEW_INTERNAL_TRANSLATE_CRIWV_TRANSLATE_RANKER_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698