| Index: chrome/browser/extensions/extension_keybinding_registry_tracker.h
|
| diff --git a/chrome/browser/extensions/extension_keybinding_registry_tracker.h b/chrome/browser/extensions/extension_keybinding_registry_tracker.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0b53bb1fbafbd486a70fd7ef57f6bf2ab5ced3a0
|
| --- /dev/null
|
| +++ b/chrome/browser/extensions/extension_keybinding_registry_tracker.h
|
| @@ -0,0 +1,59 @@
|
| +// Copyright 2014 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_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_TRACKER_H_
|
| +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_TRACKER_H_
|
| +
|
| +#include "chrome/browser/extensions/extension_keybinding_registry.h"
|
| +#include "extensions/browser/browser_context_keyed_api_factory.h"
|
| +
|
| +namespace content {
|
| +class BrowserContext;
|
| +}
|
| +
|
| +namespace extensions {
|
| +
|
| +// ExtensionKeybindingRegistryTracker holds the active BrowserWindow's
|
| +// ExtensionKeybindingRegistry.
|
| +class ExtensionKeybindingRegistryTracker : public BrowserContextKeyedAPI {
|
| + public:
|
| + explicit ExtensionKeybindingRegistryTracker(content::BrowserContext* context);
|
| + virtual ~ExtensionKeybindingRegistryTracker();
|
| +
|
| + // BrowserContextKeyedAPI implementation.
|
| + static BrowserContextKeyedAPIFactory<ExtensionKeybindingRegistryTracker>*
|
| + GetFactoryInstance();
|
| +
|
| + // Convenience method to get the ExtensionKeybindingRegistryTracker for a
|
| + // browser context.
|
| + static ExtensionKeybindingRegistryTracker* Get(
|
| + content::BrowserContext* context);
|
| +
|
| + // Sets the active ExtensionKeybindingRegistry.
|
| + void SetActiveRegistry(ExtensionKeybindingRegistry* registry);
|
| +
|
| + // Gets the active ExtensionKeybindingRegistry.
|
| + ExtensionKeybindingRegistry* GetActiveRegistry();
|
| +
|
| + private:
|
| + friend class BrowserContextKeyedAPIFactory<
|
| + ExtensionKeybindingRegistryTracker>;
|
| +
|
| + // BrowserContextKeyedAPI implementation.
|
| + static const char* service_name() {
|
| + return "ExtensionKeybindingRegistryTracker";
|
| + }
|
| +
|
| + // Weak pointer to our browser context. Not owned by us.
|
| + content::BrowserContext* browser_context_;
|
| +
|
| + // The active ExtensionKeybindingRegistry.
|
| + ExtensionKeybindingRegistry* registry_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryTracker);
|
| +};
|
| +
|
| +} // namespace extensions
|
| +
|
| +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_TRACKER_H_
|
|
|