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

Side by Side Diff: ui/events/event.h

Issue 929053004: [KeyboardEvent] Add embedder APIs to translate between Dom |key| enum and strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup of the dom_key.h Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/event_types.h" 10 #include "base/event_types.h"
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 // TODO(msw): Additional work may be needed for analogues on other platforms. 731 // TODO(msw): Additional work may be needed for analogues on other platforms.
732 bool IsUnicodeKeyCode() const; 732 bool IsUnicodeKeyCode() const;
733 733
734 // Returns the DOM .code (physical key identifier) for a keystroke event. 734 // Returns the DOM .code (physical key identifier) for a keystroke event.
735 DomCode code() const { return code_; }; 735 DomCode code() const { return code_; };
736 std::string GetCodeString() const; 736 std::string GetCodeString() const;
737 737
738 // Returns the DOM .key (layout meaning) for a keystroke event. 738 // Returns the DOM .key (layout meaning) for a keystroke event.
739 DomKey GetDomKey() const; 739 DomKey GetDomKey() const;
740 740
741 // Returns either DomKey or Unicode value + DomKey::CHARACTER.
742 int GetDomKeyOrCharacter() const;
743
741 // Normalizes flags_ so that it describes the state after the event. 744 // Normalizes flags_ so that it describes the state after the event.
742 // (Native X11 event flags describe the state before the event.) 745 // (Native X11 event flags describe the state before the event.)
743 void NormalizeFlags(); 746 void NormalizeFlags();
744 747
745 protected: 748 protected:
746 friend class KeyEventTestApi; 749 friend class KeyEventTestApi;
747 750
748 // This allows a subclass TranslatedKeyEvent to be a non character event. 751 // This allows a subclass TranslatedKeyEvent to be a non character event.
749 void set_is_char(bool is_char) { is_char_ = is_char; } 752 void set_is_char(bool is_char) { is_char_ = is_char; }
750 753
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 874
872 const GestureEventDetails& details() const { return details_; } 875 const GestureEventDetails& details() const { return details_; }
873 876
874 private: 877 private:
875 GestureEventDetails details_; 878 GestureEventDetails details_;
876 }; 879 };
877 880
878 } // namespace ui 881 } // namespace ui
879 882
880 #endif // UI_EVENTS_EVENT_H_ 883 #endif // UI_EVENTS_EVENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698