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

Unified Diff: chrome/browser/extensions/extension_keybinding_registry.h

Issue 9618009: Move the .h ExtensionKeybindingRegistry implementation to the Views specific section, since it cont… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_keybinding_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_keybinding_registry.h
===================================================================
--- chrome/browser/extensions/extension_keybinding_registry.h (revision 125151)
+++ chrome/browser/extensions/extension_keybinding_registry.h (working copy)
@@ -1,72 +0,0 @@
-// Copyright (c) 2012 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_H_
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_
-#pragma once
-
-#include <map>
-#include <string>
-#include <utility>
-
-#include "base/compiler_specific.h"
-#include "content/public/browser/notification_details.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-#include "content/public/browser/notification_source.h"
-#include "ui/base/accelerators/accelerator.h"
-
-class Extension;
-class Profile;
-
-namespace views {
-class FocusManager;
-}
-
-// The ExtensionKeybindingRegistry is a class that handles keyboard accelerators
-// for regular extension commands (other than displaying browserAction and
-// pageAction popups). It registers all those accelerators on behalf of the
-// extensions and routes the commands to them via the BrowserEventRouter.
-class ExtensionKeybindingRegistry : ui::AcceleratorTarget,
- public content::NotificationObserver {
- public:
- ExtensionKeybindingRegistry(Profile* profile,
- views::FocusManager* focus_manager);
- virtual ~ExtensionKeybindingRegistry();
-
- // Overridden from ui::AcceleratorTarget.
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
- virtual bool CanHandleAccelerators() const OVERRIDE;
-
- // Overridden from content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- private:
- void AddExtensionKeybinding(const Extension* extension);
- void RemoveExtensionKeybinding(const Extension* extension);
-
- // Whether to ignore this command.
- bool ShouldIgnoreCommand(const std::string& command) const;
-
- // Weak pointer back to parent profile.
- Profile* profile_;
-
- // Weak pointer back to the focus manager to use to register and unregister
- // accelerators with.
- views::FocusManager* focus_manager_;
-
- // Maps an accelerator to a string pair (extension id, command name).
- typedef std::map< ui::Accelerator,
- std::pair<std::string, std::string> > EventTargets;
- EventTargets event_targets_;
-
- // The content notification registrar for listening to extension events.
- content::NotificationRegistrar registrar_;
-
- DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry);
-};
-
-#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_keybinding_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698