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

Unified Diff: chrome/browser/android/blimp/blimp_client_context_factory.h

Issue 2132163002: Add BlimpClientContext and factory with real and dummy implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-blimp-client-core-public-to-blimp-client
Patch Set: merge origin/master for good measure Created 4 years, 5 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/android/blimp/blimp_client_context_factory.h
diff --git a/chrome/browser/android/blimp/blimp_client_context_factory.h b/chrome/browser/android/blimp/blimp_client_context_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..23bb92c0bf11f52c03bcfa3fa25ea7b2d935fee7
--- /dev/null
+++ b/chrome/browser/android/blimp/blimp_client_context_factory.h
@@ -0,0 +1,56 @@
+// 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_ANDROID_BLIMP_BLIMP_CLIENT_CONTEXT_FACTORY_H_
+#define CHROME_BROWSER_ANDROID_BLIMP_BLIMP_CLIENT_CONTEXT_FACTORY_H_
+
+#include "base/macros.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+namespace base {
+template <typename T>
+struct DefaultSingletonTraits;
+} // namespace base
+
+namespace blimp {
+namespace client {
+class BlimpClientContext;
+} // namespace client
+} // namespace blimp
+
+namespace content {
+class BrowserContext;
+} // namespace content
+
+namespace chrome {
Lei Zhang 2016/07/14 23:21:57 BTW, a few years ago we decided chrome/ was top le
nyquist 2016/07/15 17:38:19 Done. Thanks for the history! :-)
+
+// BlimpClientContextFactory is the main client class for interactive with
+// blimp.
+class BlimpClientContextFactory : public BrowserContextKeyedServiceFactory {
+ public:
+ // Returns singleton instance of BlimpClientContextFactory.
+ static BlimpClientContextFactory* GetInstance();
+
+ // Returns the BlimpClientContext associated with |context|.
+ static blimp::client::BlimpClientContext* GetForBrowserContext(
+ content::BrowserContext* context);
+
+ private:
+ friend struct base::DefaultSingletonTraits<BlimpClientContextFactory>;
+
+ BlimpClientContextFactory();
+ ~BlimpClientContextFactory() override;
+
+ // BrowserContextKeyedServiceFactory overrides:
+ KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const override;
+ content::BrowserContext* GetBrowserContextToUse(
+ content::BrowserContext* context) const override;
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpClientContextFactory);
+};
+
+} // namespace chrome
+
+#endif // CHROME_BROWSER_ANDROID_BLIMP_BLIMP_CLIENT_CONTEXT_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698