Chromium Code Reviews| 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 CHROME_BROWSER_ANDROID_BLIMP_BLIMP_CLIENT_CONTEXT_FACTORY_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_BLIMP_BLIMP_CLIENT_CONTEXT_FACTORY_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | |
| 10 | |
| 11 namespace base { | |
| 12 template <typename T> | |
| 13 struct DefaultSingletonTraits; | |
| 14 } // namespace base | |
| 15 | |
| 16 namespace blimp { | |
| 17 namespace client { | |
| 18 class BlimpClientContext; | |
| 19 } // namespace client | |
| 20 } // namespace blimp | |
| 21 | |
| 22 namespace content { | |
| 23 class BrowserContext; | |
| 24 } // namespace content | |
| 25 | |
| 26 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! :-)
| |
| 27 | |
| 28 // BlimpClientContextFactory is the main client class for interactive with | |
| 29 // blimp. | |
| 30 class BlimpClientContextFactory : public BrowserContextKeyedServiceFactory { | |
| 31 public: | |
| 32 // Returns singleton instance of BlimpClientContextFactory. | |
| 33 static BlimpClientContextFactory* GetInstance(); | |
| 34 | |
| 35 // Returns the BlimpClientContext associated with |context|. | |
| 36 static blimp::client::BlimpClientContext* GetForBrowserContext( | |
| 37 content::BrowserContext* context); | |
| 38 | |
| 39 private: | |
| 40 friend struct base::DefaultSingletonTraits<BlimpClientContextFactory>; | |
| 41 | |
| 42 BlimpClientContextFactory(); | |
| 43 ~BlimpClientContextFactory() override; | |
| 44 | |
| 45 // BrowserContextKeyedServiceFactory overrides: | |
| 46 KeyedService* BuildServiceInstanceFor( | |
| 47 content::BrowserContext* context) const override; | |
| 48 content::BrowserContext* GetBrowserContextToUse( | |
| 49 content::BrowserContext* context) const override; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextFactory); | |
| 52 }; | |
| 53 | |
| 54 } // namespace chrome | |
| 55 | |
| 56 #endif // CHROME_BROWSER_ANDROID_BLIMP_BLIMP_CLIENT_CONTEXT_FACTORY_H_ | |
| OLD | NEW |