base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON().
[chromium-blink-merge.git] / ui / events / linux / text_edit_key_bindings_delegate_auralinux.h
blobd2916260380b64b67b69e4ce07426bd6e8cad654
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_X_TEXT_EDIT_KEY_BINDINGS_DELEGATE_X11_H_
6 #define UI_EVENTS_X_TEXT_EDIT_KEY_BINDINGS_DELEGATE_X11_H_
8 #include <vector>
10 #include "ui/events/events_export.h"
12 namespace ui {
13 class Event;
14 class TextEditCommandAuraLinux;
16 // An interface which can interpret various text editing commands out of key
17 // events.
19 // On desktop Linux, we've traditionally supported the user's custom
20 // keybindings. We need to support this in both content/ and in views/.
21 class EVENTS_EXPORT TextEditKeyBindingsDelegateAuraLinux {
22 public:
23 // Matches a key event against the users' platform specific key bindings,
24 // false will be returned if the key event doesn't correspond to a predefined
25 // key binding. Edit commands matched with |event| will be stored in
26 // |edit_commands|, if |edit_commands| is non-NULL.
27 virtual bool MatchEvent(const ui::Event& event,
28 std::vector<TextEditCommandAuraLinux>* commands) = 0;
30 protected:
31 virtual ~TextEditKeyBindingsDelegateAuraLinux() {}
34 // Sets/Gets the global TextEditKeyBindingsDelegateAuraLinux. No ownership
35 // changes. Can be NULL.
36 EVENTS_EXPORT void SetTextEditKeyBindingsDelegate(
37 TextEditKeyBindingsDelegateAuraLinux* delegate);
38 EVENTS_EXPORT TextEditKeyBindingsDelegateAuraLinux*
39 GetTextEditKeyBindingsDelegate();
41 } // namespace ui
43 #endif // UI_EVENTS_X_TEXT_EDIT_KEY_BINDINGS_DELEGATE_X11_H_