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

Unified Diff: views/focus/accelerator_handler.h

Issue 159046: Implementing accelerators for Linux toolkit_views (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « views/event_gtk.cc ('k') | views/focus/accelerator_handler_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/accelerator_handler.h
===================================================================
--- views/focus/accelerator_handler.h (revision 21181)
+++ views/focus/accelerator_handler.h (working copy)
@@ -2,29 +2,39 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef VIEWS_WIDGET_ACCELERATOR_HANDLER_H_
-#define VIEWS_WIDGET_ACCELERATOR_HANDLER_H_
+#ifndef VIEWS_FOCUS_ACCELERATOR_HANDLER_H_
+#define VIEWS_FOCUS_ACCELERATOR_HANDLER_H_
+#if defined(OS_LINUX)
+#include <gdk/gdk.h>
+#endif
+
#include "base/message_loop.h"
namespace views {
-// This class delegates WM_KEYDOWN and WM_SYSKEYDOWN messages to
-// the associated FocusManager class for the window that is receiving
-// these messages for accelerator processing. The BrowserProcess object
-// holds a singleton instance of this class which can be used by other
-// custom message loop dispatcher objects to implement default accelerator
-// handling.
+// This class delegates the key messages to the associated FocusManager class
+// for the window that is receiving these messages for accelerator processing.
class AcceleratorHandler : public MessageLoopForUI::Dispatcher {
public:
AcceleratorHandler();
- // Dispatcher method. This returns true if an accelerator was
- // processed by the focus manager
+ // Dispatcher method. This returns true if an accelerator was processed by the
+ // focus manager
+#if defined(OS_WIN)
virtual bool Dispatch(const MSG& msg);
+#else
+ virtual bool Dispatch(GdkEvent* event);
+#endif
+
private:
- DISALLOW_EVIL_CONSTRUCTORS(AcceleratorHandler);
+#if defined(OS_LINUX)
+ // Last key pressed and consumed as an accelerator.
+ guint last_key_pressed_;
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler);
};
} // namespace views
-#endif // VIEWS_WIDGET_ACCELERATOR_HANDLER_H_
+#endif // VIEWS_FOCUS_ACCELERATOR_HANDLER_H_
« no previous file with comments | « views/event_gtk.cc ('k') | views/focus/accelerator_handler_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698