| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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_LANGUAGE_MODEL_FACTORY_H |
| 6 #define IOS_CHROME_BROWSER_TRANSLATE_LANGUAGE_MODEL_FACTORY_H |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/memory/singleton.h" |
| 11 #include "components/keyed_service/core/keyed_service.h" |
| 12 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" |
| 13 |
| 14 namespace ios { |
| 15 class ChromeBrowserState; |
| 16 } |
| 17 |
| 18 namespace translate { |
| 19 class LanguageModel; |
| 20 } |
| 21 |
| 22 class LanguageModelFactory : public BrowserStateKeyedServiceFactory { |
| 23 public: |
| 24 static LanguageModelFactory* GetInstance(); |
| 25 static translate::LanguageModel* GetForBrowserState( |
| 26 ios::ChromeBrowserState* browser_state); |
| 27 |
| 28 private: |
| 29 friend struct base::DefaultSingletonTraits<LanguageModelFactory>; |
| 30 |
| 31 LanguageModelFactory(); |
| 32 ~LanguageModelFactory() override; |
| 33 |
| 34 // BrowserStateKeyedServiceFactory implementation. |
| 35 std::unique_ptr<KeyedService> BuildServiceInstanceFor( |
| 36 web::BrowserState* context) const override; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(LanguageModelFactory); |
| 39 }; |
| 40 |
| 41 #endif // IOS_CHROME_BROWSER_TRANSLATE_LANGUAGE_MODEL_FACTORY_H |
| OLD | NEW |