| OLD | NEW |
| (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_WEB_VIEW_TRANSLATE_RANKER_FACTORY_H_ | |
| 6 #define IOS_WEB_VIEW_INTERNAL_TRANSLATE_WEB_VIEW_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 WebViewBrowserState; | |
| 24 | |
| 25 // TranslateRankerFactory is a way to associate a | |
| 26 // TranslateRanker instance to a BrowserState. | |
| 27 class WebViewTranslateRankerFactory : public BrowserStateKeyedServiceFactory { | |
| 28 public: | |
| 29 static translate::TranslateRanker* GetForBrowserState( | |
| 30 WebViewBrowserState* browser_state); | |
| 31 static WebViewTranslateRankerFactory* GetInstance(); | |
| 32 | |
| 33 private: | |
| 34 friend struct base::DefaultSingletonTraits<WebViewTranslateRankerFactory>; | |
| 35 | |
| 36 WebViewTranslateRankerFactory(); | |
| 37 ~WebViewTranslateRankerFactory() override; | |
| 38 | |
| 39 // BrowserStateKeyedServiceFactory implementation. | |
| 40 std::unique_ptr<KeyedService> BuildServiceInstanceFor( | |
| 41 web::BrowserState* context) const override; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(WebViewTranslateRankerFactory); | |
| 44 }; | |
| 45 | |
| 46 } // namespace ios_web_view | |
| 47 | |
| 48 #endif // IOS_WEB_VIEW_INTERNAL_TRANSLATE_WEB_VIEW_TRANSLATE_RANKER_FACTORY_H_ | |
| OLD | NEW |