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

Side by Side Diff: Source/core/events/UIEventWithKeyState.h

Issue 1350933003: Implement MouseEvent.getModifierState (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add LayoutTests Created 5 years, 3 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) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 24 matching lines...) Expand all
35 bool shiftKey() const { return m_shiftKey; } 35 bool shiftKey() const { return m_shiftKey; }
36 bool altKey() const { return m_altKey; } 36 bool altKey() const { return m_altKey; }
37 bool metaKey() const { return m_metaKey; } 37 bool metaKey() const { return m_metaKey; }
38 38
39 // We ignore the new tab modifiers (ctrl or meta, depending on OS) set by Ja vaScript when processing events. 39 // We ignore the new tab modifiers (ctrl or meta, depending on OS) set by Ja vaScript when processing events.
40 // However, scripts running in isolated worlds (aka content scripts) are not subject to this restriction. Since it is possible that an event created by a co ntent script is caught and recreated by the web page's script, we resort to a gl obal flag. 40 // However, scripts running in isolated worlds (aka content scripts) are not subject to this restriction. Since it is possible that an event created by a co ntent script is caught and recreated by the web page's script, we resort to a gl obal flag.
41 static bool newTabModifierSetFromIsolatedWorld() { return s_newTabModifierSe tFromIsolatedWorld; } 41 static bool newTabModifierSetFromIsolatedWorld() { return s_newTabModifierSe tFromIsolatedWorld; }
42 static void clearNewTabModifierSetFromIsolatedWorld() { s_newTabModifierSetF romIsolatedWorld = false; } 42 static void clearNewTabModifierSetFromIsolatedWorld() { s_newTabModifierSetF romIsolatedWorld = false; }
43 static void didCreateEventInIsolatedWorld(bool ctrlKey, bool shiftKey, bool altKey, bool metaKey); 43 static void didCreateEventInIsolatedWorld(bool ctrlKey, bool shiftKey, bool altKey, bool metaKey);
44 44
45 bool getModifierState(const String& keyIdentifier) const;
46
45 protected: 47 protected:
46 UIEventWithKeyState() 48 UIEventWithKeyState()
47 : m_ctrlKey(false) 49 : m_ctrlKey(false)
48 , m_altKey(false) 50 , m_altKey(false)
49 , m_shiftKey(false) 51 , m_shiftKey(false)
50 , m_metaKey(false) 52 , m_metaKey(false)
51 { 53 {
52 } 54 }
53 55
54 UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelabl e, PassRefPtrWillBeRawPtr<AbstractView> view, 56 UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelabl e, PassRefPtrWillBeRawPtr<AbstractView> view,
(...skipping 14 matching lines...) Expand all
69 71
70 private: 72 private:
71 static bool s_newTabModifierSetFromIsolatedWorld; 73 static bool s_newTabModifierSetFromIsolatedWorld;
72 }; 74 };
73 75
74 UIEventWithKeyState* findEventWithKeyState(Event*); 76 UIEventWithKeyState* findEventWithKeyState(Event*);
75 77
76 } // namespace blink 78 } // namespace blink
77 79
78 #endif // UIEventWithKeyState_h 80 #endif // UIEventWithKeyState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698