1f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
2f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// found in the LICENSE file.
4f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
5f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#ifndef CHROME_BROWSER_EXTENSIONS_MENU_MANAGER_FACTORY_H_
6f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#define CHROME_BROWSER_EXTENSIONS_MENU_MANAGER_FACTORY_H_
7f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
8f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "base/memory/scoped_ptr.h"
9f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "base/memory/singleton.h"
10a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
11f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
125f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace content {
135f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class BrowserContext;
145f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)}
15f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
16f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)namespace extensions {
17f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)class MenuManager;
18f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
19f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)class MenuManagerFactory : public BrowserContextKeyedServiceFactory {
20f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) public:
215f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  static MenuManager* GetForBrowserContext(content::BrowserContext* context);
22f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
23f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  static MenuManagerFactory* GetInstance();
24f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
256e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  static KeyedService* BuildServiceInstanceForTesting(
266e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      content::BrowserContext* context);
276e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
28f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) private:
29f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  friend struct DefaultSingletonTraits<MenuManagerFactory>;
30f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
31f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  MenuManagerFactory();
32f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual ~MenuManagerFactory();
33f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
34a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual KeyedService* BuildServiceInstanceFor(
355f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)      content::BrowserContext* context) const OVERRIDE;
36f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual content::BrowserContext* GetBrowserContextToUse(
37f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)      content::BrowserContext* context) const OVERRIDE;
38f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
39f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
40f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)};
41f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
42f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)}  // namespace extensions
43f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
44f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#endif  // CHROME_BROWSER_EXTENSIONS_MENU_MANAGER_FACTORY_H_
45