| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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_CHROME_BROWSER_TRANSLATE_TRANSLATE_RANKER_FACTORY_H_ | |
| 6 #define IOS_CHROME_BROWSER_TRANSLATE_TRANSLATE_RANKER_FACTORY_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" | |
| 12 | |
| 13 namespace base { | |
| 14 template <typename T> | |
| 15 struct DefaultSingletonTraits; | |
| 16 } | |
| 17 | |
| 18 namespace ios { | |
| 19 class ChromeBrowserState; | |
| 20 } | |
| 21 | |
| 22 namespace translate { | |
| 23 | |
| 24 class TranslateRanker; | |
| 25 | |
| 26 // TranslateRankerFactory is a way to associate a TranslateRanker instance to | |
| 27 // a BrowserState. | |
| 28 class TranslateRankerFactory : public BrowserStateKeyedServiceFactory { | |
| 29 public: | |
| 30 static translate::TranslateRanker* GetForBrowserState( | |
| 31 ios::ChromeBrowserState* browser_state); | |
| 32 static TranslateRankerFactory* GetInstance(); | |
| 33 | |
| 34 private: | |
| 35 friend struct base::DefaultSingletonTraits<TranslateRankerFactory>; | |
| 36 | |
| 37 TranslateRankerFactory(); | |
| 38 ~TranslateRankerFactory() override; | |
| 39 | |
| 40 // BrowserStateKeyedServiceFactory implementation. | |
| 41 std::unique_ptr<KeyedService> BuildServiceInstanceFor( | |
| 42 web::BrowserState* context) const override; | |
| 43 web::BrowserState* GetBrowserStateToUse( | |
| 44 web::BrowserState* context) const override; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(TranslateRankerFactory); | |
| 47 }; | |
| 48 | |
| 49 } // namespace translate | |
| 50 | |
| 51 #endif // IOS_CHROME_BROWSER_TRANSLATE_TRANSLATE_RANKER_FACTORY_H_ | |
| OLD | NEW |