OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class CORE_EXPORT UIEventWithKeyState : public UIEvent { | 33 class CORE_EXPORT UIEventWithKeyState : public UIEvent { |
34 public: | 34 public: |
35 bool ctrlKey() const { return m_modifiers & PlatformEvent::CtrlKey; } | 35 bool ctrlKey() const { return m_modifiers & PlatformEvent::CtrlKey; } |
36 bool shiftKey() const { return m_modifiers & PlatformEvent::ShiftKey; } | 36 bool shiftKey() const { return m_modifiers & PlatformEvent::ShiftKey; } |
37 bool altKey() const { return m_modifiers & PlatformEvent::AltKey; } | 37 bool altKey() const { return m_modifiers & PlatformEvent::AltKey; } |
38 bool metaKey() const { return m_modifiers & PlatformEvent::MetaKey; } | 38 bool metaKey() const { return m_modifiers & PlatformEvent::MetaKey; } |
39 | 39 |
40 // We ignore the new tab modifiers (ctrl or meta, depending on OS) set by Java
Script when processing events. | 40 // We ignore the new tab modifiers (ctrl or meta, depending on OS) set by |
41 // However, scripts running in isolated worlds (aka content scripts) are not s
ubject to this restriction. Since it is possible that an event created by a cont
ent script is caught and recreated by the web page's script, we resort to a glob
al flag. | 41 // JavaScript when processing events. However, scripts running in isolated |
| 42 // worlds (aka content scripts) are not subject to this restriction. Since it |
| 43 // is possible that an event created by a content script is caught and |
| 44 // recreated by the web page's script, we resort to a global flag. |
42 static bool newTabModifierSetFromIsolatedWorld() { | 45 static bool newTabModifierSetFromIsolatedWorld() { |
43 return s_newTabModifierSetFromIsolatedWorld; | 46 return s_newTabModifierSetFromIsolatedWorld; |
44 } | 47 } |
45 static void clearNewTabModifierSetFromIsolatedWorld() { | 48 static void clearNewTabModifierSetFromIsolatedWorld() { |
46 s_newTabModifierSetFromIsolatedWorld = false; | 49 s_newTabModifierSetFromIsolatedWorld = false; |
47 } | 50 } |
48 static void didCreateEventInIsolatedWorld(bool ctrlKey, | 51 static void didCreateEventInIsolatedWorld(bool ctrlKey, |
49 bool shiftKey, | 52 bool shiftKey, |
50 bool altKey, | 53 bool altKey, |
51 bool metaKey); | 54 bool metaKey); |
(...skipping 26 matching lines...) Expand all Loading... |
78 | 81 |
79 private: | 82 private: |
80 static bool s_newTabModifierSetFromIsolatedWorld; | 83 static bool s_newTabModifierSetFromIsolatedWorld; |
81 }; | 84 }; |
82 | 85 |
83 UIEventWithKeyState* findEventWithKeyState(Event*); | 86 UIEventWithKeyState* findEventWithKeyState(Event*); |
84 | 87 |
85 } // namespace blink | 88 } // namespace blink |
86 | 89 |
87 #endif // UIEventWithKeyState_h | 90 #endif // UIEventWithKeyState_h |
OLD | NEW |