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

Unified Diff: ui/views/events/event_x.cc

Issue 10825254: Remove views::KeyEvent, replacing uses of it with ui::KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/events/event_win.cc ('k') | ui/views/examples/textfield_example.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/events/event_x.cc
===================================================================
--- ui/views/events/event_x.cc (revision 150588)
+++ ui/views/events/event_x.cc (working copy)
@@ -20,49 +20,6 @@
namespace views {
////////////////////////////////////////////////////////////////////////////////
-// KeyEvent, public:
-
-uint16 KeyEvent::GetCharacter() const {
- if (character_)
- return character_;
-
- if (!native_event()) {
- return ui::GetCharacterFromKeyCode(key_code_, flags());
- }
-
- DCHECK(native_event()->type == KeyPress ||
- native_event()->type == KeyRelease);
-
- uint16 ch = 0;
- if (!IsControlDown())
- ch = ui::GetCharacterFromXEvent(native_event());
- return ch ? ch : ui::GetCharacterFromKeyCode(key_code_, flags());
-}
-
-uint16 KeyEvent::GetUnmodifiedCharacter() const {
- if (unmodified_character_)
- return unmodified_character_;
-
- if (!native_event()) {
- return ui::GetCharacterFromKeyCode(key_code_, flags() & ui::EF_SHIFT_DOWN);
- }
-
- DCHECK(native_event()->type == KeyPress ||
- native_event()->type == KeyRelease);
-
- static const unsigned int kIgnoredModifiers = ControlMask | LockMask |
- Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask;
-
- XKeyEvent copy = native_event()->xkey; // bit-wise copy is safe.
- // We can't use things like (native_event()->xkey.state & ShiftMask), as it
- // may mask out bits used by X11 internally.
- copy.state &= ~kIgnoredModifiers;
- uint16 ch = ui::GetCharacterFromXEvent(reinterpret_cast<XEvent*>(&copy));
- return ch ? ch :
- ui::GetCharacterFromKeyCode(key_code_, flags() & ui::EF_SHIFT_DOWN);
-}
-
-////////////////////////////////////////////////////////////////////////////////
// TouchEvent, public:
TouchEvent::TouchEvent(const base::NativeEvent& native_event)
« no previous file with comments | « ui/views/events/event_win.cc ('k') | ui/views/examples/textfield_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698