OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_EVENTS_EVENT_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_EVENTS_EVENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
911 void NormalizeFlags(); | 911 void NormalizeFlags(); |
912 | 912 |
913 // Sets the properties associated with this KeyEvent. | 913 // Sets the properties associated with this KeyEvent. |
914 void SetProperties(const Properties& properties); | 914 void SetProperties(const Properties& properties); |
915 | 915 |
916 // Returns the properties associated with this event, which may be null. | 916 // Returns the properties associated with this event, which may be null. |
917 // The properties are meant to provide a way to associate arbitrary key/value | 917 // The properties are meant to provide a way to associate arbitrary key/value |
918 // pairs with KeyEvents and not used by KeyEvent. | 918 // pairs with KeyEvents and not used by KeyEvent. |
919 const Properties* properties() const { return properties_.get(); } | 919 const Properties* properties() const { return properties_.get(); } |
920 | 920 |
921 // True to skip sending event to the InputMethod. | |
922 void set_skip_ime(bool skip_ime) { skip_ime_ = skip_ime; } | |
923 | |
924 bool should_skip_ime() const { return skip_ime_; } | |
sadrul
2017/05/15 14:44:25
Just want to note that we have previously used eve
| |
925 | |
921 protected: | 926 protected: |
922 friend class KeyEventTestApi; | 927 friend class KeyEventTestApi; |
923 | 928 |
924 // This allows a subclass TranslatedKeyEvent to be a non character event. | 929 // This allows a subclass TranslatedKeyEvent to be a non character event. |
925 void set_is_char(bool is_char) { is_char_ = is_char; } | 930 void set_is_char(bool is_char) { is_char_ = is_char; } |
926 | 931 |
927 private: | 932 private: |
928 // Determine key_ on a keystroke event from code_ and flags(). | 933 // Determine key_ on a keystroke event from code_ and flags(). |
929 void ApplyLayout() const; | 934 void ApplyLayout() const; |
930 | 935 |
(...skipping 18 matching lines...) Expand all Loading... | |
949 // | 954 // |
950 // DOM KeyboardEvent |key| | 955 // DOM KeyboardEvent |key| |
951 // http://www.w3.org/TR/DOM-Level-3-Events-key/ | 956 // http://www.w3.org/TR/DOM-Level-3-Events-key/ |
952 // | 957 // |
953 // This value represents the meaning of a key, which is either a Unicode | 958 // This value represents the meaning of a key, which is either a Unicode |
954 // character, or a named DomKey:: value. | 959 // character, or a named DomKey:: value. |
955 // This is not necessarily initialized when the event is constructed; | 960 // This is not necessarily initialized when the event is constructed; |
956 // it may be set only if and when GetCharacter() or GetDomKey() is called. | 961 // it may be set only if and when GetCharacter() or GetDomKey() is called. |
957 mutable DomKey key_ = DomKey::NONE; | 962 mutable DomKey key_ = DomKey::NONE; |
958 | 963 |
964 bool skip_ime_ = false; | |
sadrul
2017/05/15 14:44:24
Does this need to be retained when dispatching eve
| |
965 | |
959 std::unique_ptr<Properties> properties_; | 966 std::unique_ptr<Properties> properties_; |
960 | 967 |
961 static KeyEvent* last_key_event_; | 968 static KeyEvent* last_key_event_; |
962 #if defined(USE_X11) | 969 #if defined(USE_X11) |
963 static KeyEvent* last_ibus_key_event_; | 970 static KeyEvent* last_ibus_key_event_; |
964 #endif | 971 #endif |
965 }; | 972 }; |
966 | 973 |
967 class EVENTS_EXPORT ScrollEvent : public MouseEvent { | 974 class EVENTS_EXPORT ScrollEvent : public MouseEvent { |
968 public: | 975 public: |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1053 // dispatched. This field gets a non-zero value only for gestures that are | 1060 // dispatched. This field gets a non-zero value only for gestures that are |
1054 // released through TouchDispositionGestureFilter::SendGesture. The gesture | 1061 // released through TouchDispositionGestureFilter::SendGesture. The gesture |
1055 // events that aren't fired directly in response to processing a touch-event | 1062 // events that aren't fired directly in response to processing a touch-event |
1056 // (e.g. timer fired ones), this id is zero. See crbug.com/618738. | 1063 // (e.g. timer fired ones), this id is zero. See crbug.com/618738. |
1057 uint32_t unique_touch_event_id_; | 1064 uint32_t unique_touch_event_id_; |
1058 }; | 1065 }; |
1059 | 1066 |
1060 } // namespace ui | 1067 } // namespace ui |
1061 | 1068 |
1062 #endif // UI_EVENTS_EVENT_H_ | 1069 #endif // UI_EVENTS_EVENT_H_ |
OLD | NEW |