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

Unified Diff: chrome/browser/translate/language_model_factory.h

Issue 2396783002: Add LanguageModel, a keyed service that collects language info from CLD. (Closed)
Patch Set: Fixing incognito Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/translate/language_model_factory.h
diff --git a/chrome/browser/translate/language_model_factory.h b/chrome/browser/translate/language_model_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..1d68535b9ca2a3202eb22e2b40c972a4a22d2842
--- /dev/null
+++ b/chrome/browser/translate/language_model_factory.h
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_TRANSLATE_LANGUAGE_MODEL_FACTORY_H_
+#define CHROME_BROWSER_TRANSLATE_LANGUAGE_MODEL_FACTORY_H_
+
+#include "base/macros.h"
+#include "base/memory/singleton.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+namespace translate {
+class LanguageModel;
+}
+
+class LanguageModelFactory
+ : public BrowserContextKeyedServiceFactory {
+ public:
+ static LanguageModelFactory* GetInstance();
+ static translate::LanguageModel* GetForBrowserContext(
+ content::BrowserContext* browser_context);
+
+ private:
+ friend struct base::DefaultSingletonTraits<LanguageModelFactory>;
+
+ LanguageModelFactory();
+ ~LanguageModelFactory() override;
+
+ // BrowserContextKeyedServiceFactory:
+ KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const override;
+
+ DISALLOW_COPY_AND_ASSIGN(LanguageModelFactory);
+};
+
+#endif // CHROME_BROWSER_TRANSLATE_LANGUAGE_MODEL_FACTORY_H_
« no previous file with comments | « chrome/browser/translate/chrome_translate_client.cc ('k') | chrome/browser/translate/language_model_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698