Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / ios / chrome / browser / autocomplete / shortcuts_backend_factory.h
blob3fc072415fb00c8e17d528b765dae5d793e42b91
1 // Copyright 2015 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.
5 #ifndef IOS_CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_BACKEND_FACTORY_H_
6 #define IOS_CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_BACKEND_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "components/keyed_service/ios/refcounted_browser_state_keyed_service_factory.h"
12 template <typename T>
13 struct DefaultSingletonTraits;
14 class ShortcutsBackend;
16 namespace ios {
18 class ChromeBrowserState;
20 // Singleton that owns all ShortcutsBackends and associates them with
21 // ios::ChromeBrowserState.
22 class ShortcutsBackendFactory
23 : public RefcountedBrowserStateKeyedServiceFactory {
24 public:
25 static scoped_refptr<ShortcutsBackend> GetForBrowserState(
26 ios::ChromeBrowserState* browser_state);
27 static scoped_refptr<ShortcutsBackend> GetForBrowserStateIfExists(
28 ios::ChromeBrowserState* browser_state);
29 static ShortcutsBackendFactory* GetInstance();
31 private:
32 friend struct DefaultSingletonTraits<ShortcutsBackendFactory>;
34 ShortcutsBackendFactory();
35 ~ShortcutsBackendFactory() override;
37 // BrowserStateKeyedServiceFactory implementation.
38 scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor(
39 web::BrowserState* context) const override;
40 bool ServiceIsNULLWhileTesting() const override;
42 DISALLOW_COPY_AND_ASSIGN(ShortcutsBackendFactory);
45 } // namespace ios
47 #endif // IOS_CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_BACKEND_FACTORY_H_