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

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

Issue 109413003: Refactor GlobalShortcutListener. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync. Created 6 years, 12 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
Index: chrome/browser/extensions/global_shortcut_listener_x11.h
diff --git a/chrome/browser/extensions/global_shortcut_listener_x11.h b/chrome/browser/extensions/global_shortcut_listener_x11.h
index d710206e62422e9d0e70713f9a974f4d03556a0d..2a038296df057b2391a5376aa89115371294f826 100644
--- a/chrome/browser/extensions/global_shortcut_listener_x11.h
+++ b/chrome/browser/extensions/global_shortcut_listener_x11.h
@@ -5,10 +5,9 @@
#ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_X11_H_
#define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_X11_H_
-#include <set>
#include <X11/Xlib.h>
+#include <set>
-#include "base/lazy_instance.h"
#include "base/message_loop/message_pump_dispatcher.h"
#include "chrome/browser/extensions/global_shortcut_listener.h"
@@ -22,31 +21,29 @@ namespace extensions {
// X11-specific implementation of the GlobalShortcutListener class that
// listens for global shortcuts. Handles basic keyboard intercepting and
// forwards its output to the base class for processing.
-class GlobalShortcutListenerX11 : public GlobalShortcutListener,
- public base::MessagePumpDispatcher {
+class GlobalShortcutListenerX11
+ :
+#if !defined(TOOLKIT_GTK)
+ public base::MessagePumpDispatcher,
+#endif
+ public GlobalShortcutListener {
public:
+ GlobalShortcutListenerX11();
virtual ~GlobalShortcutListenerX11();
- // GlobalShortcutListener implementation.
- virtual void StartListening() OVERRIDE;
- virtual void StopListening() OVERRIDE;
-
+#if !defined(TOOLKIT_GTK)
// base::MessagePumpDispatcher implementation.
virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
+#endif
private:
- friend struct base::DefaultLazyInstanceTraits<GlobalShortcutListenerX11>;
-
- GlobalShortcutListenerX11();
-
- // Register an |accelerator| with the particular |observer|.
- virtual void RegisterAccelerator(
- const ui::Accelerator& accelerator,
- GlobalShortcutListener::Observer* observer) OVERRIDE;
- // Unregister an |accelerator| with the particular |observer|.
- virtual void UnregisterAccelerator(
- const ui::Accelerator& accelerator,
- GlobalShortcutListener::Observer* observer) OVERRIDE;
+ // GlobalShortcutListener implementation.
+ virtual void StartListening() OVERRIDE;
+ virtual void StopListening() OVERRIDE;
+ virtual bool RegisterAcceleratorImpl(
+ const ui::Accelerator& accelerator) OVERRIDE;
+ virtual void UnregisterAcceleratorImpl(
+ const ui::Accelerator& accelerator) OVERRIDE;
#if defined(TOOLKIT_GTK)
// Callback for XEvents of the default root window.
« no previous file with comments | « chrome/browser/extensions/global_shortcut_listener_win.cc ('k') | chrome/browser/extensions/global_shortcut_listener_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698