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

Side by Side Diff: third_party/WebKit/Source/platform/PlatformKeyboardEvent.cpp

Issue 2036643003: Creat a KeyboardEventManager class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move accessKeyModifiers to PlatformKeyboardEvent Created 4 years, 6 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 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google Inc. 3 * Copyright (C) 2008, 2009 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // happen to be in this range, e.g. the Apple logo (Option+Shift+K). 64 // happen to be in this range, e.g. the Apple logo (Option+Shift+K).
65 // 0xF7FF is an arbitrary cut-off. 65 // 0xF7FF is an arbitrary cut-off.
66 m_text = String(); 66 m_text = String();
67 m_unmodifiedText = String(); 67 m_unmodifiedText = String();
68 } 68 }
69 #endif 69 #endif
70 } 70 }
71 #endif 71 #endif
72 } 72 }
73 73
74 PlatformEvent::Modifiers PlatformKeyboardEvent::accessKeyModifiers()
75 {
76 #if OS(MACOSX)
Rick Byers 2016/06/08 17:58:16 normally we prefer to avoid #ifdefs in blink for p
Navid Zolghadr 2016/06/08 18:55:08 Done.
77 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
78 #else
79 return PlatformEvent::AltKey;
80 #endif
81 }
82
74 bool PlatformKeyboardEvent::currentCapsLockState() 83 bool PlatformKeyboardEvent::currentCapsLockState()
75 { 84 {
76 switch (s_overrideCapsLockState) { 85 switch (s_overrideCapsLockState) {
77 case OverrideCapsLockState::Default: 86 case OverrideCapsLockState::Default:
78 #if OS(WIN) 87 #if OS(WIN)
79 // FIXME: Does this even work inside the sandbox? 88 // FIXME: Does this even work inside the sandbox?
80 return GetKeyState(VK_CAPITAL) & 1; 89 return GetKeyState(VK_CAPITAL) & 1;
81 #elif OS(MACOSX) 90 #elif OS(MACOSX)
82 return GetCurrentKeyModifiers() & alphaLock; 91 return GetCurrentKeyModifiers() & alphaLock;
83 #else 92 #else
(...skipping 29 matching lines...) Expand all
113 if (currentModifiers & ::cmdKey) 122 if (currentModifiers & ::cmdKey)
114 modifiers |= MetaKey; 123 modifiers |= MetaKey;
115 #else 124 #else
116 // TODO(crbug.com/538289): Implement on other platforms. 125 // TODO(crbug.com/538289): Implement on other platforms.
117 return static_cast<Modifiers>(0); 126 return static_cast<Modifiers>(0);
118 #endif 127 #endif
119 return static_cast<Modifiers>(modifiers); 128 return static_cast<Modifiers>(modifiers);
120 } 129 }
121 130
122 } // namespace blink 131 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698