OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 virtual void setJavascriptPrompt() OVERRIDE | 83 virtual void setJavascriptPrompt() OVERRIDE |
84 { | 84 { |
85 if (WTF::currentTime() - m_timestamp > userGestureTimeout) | 85 if (WTF::currentTime() - m_timestamp > userGestureTimeout) |
86 return; | 86 return; |
87 if (hasGestures()) | 87 if (hasGestures()) |
88 m_javascriptPrompt = true; | 88 m_javascriptPrompt = true; |
89 } | 89 } |
90 | 90 |
91 virtual bool wasForwarded() const OVERRIDE | |
92 { | |
93 return m_forwarded; | |
94 } | |
95 | |
96 virtual void setForwarded() OVERRIDE | |
97 { | |
98 m_forwarded = true; | |
99 } | |
100 | |
101 private: | 91 private: |
102 GestureToken() | 92 GestureToken() |
103 : m_consumableGestures(0), | 93 : m_consumableGestures(0), |
104 m_timestamp(0), | 94 m_timestamp(0), |
105 m_outOfProcess(false), | 95 m_outOfProcess(false), |
106 m_javascriptPrompt(false), | 96 m_javascriptPrompt(false) |
107 m_forwarded(false) | |
108 { | 97 { |
109 } | 98 } |
110 | 99 |
111 size_t m_consumableGestures; | 100 size_t m_consumableGestures; |
112 double m_timestamp; | 101 double m_timestamp; |
113 bool m_outOfProcess; | 102 bool m_outOfProcess; |
114 bool m_javascriptPrompt; | 103 bool m_javascriptPrompt; |
115 bool m_forwarded; | |
116 }; | 104 }; |
117 | 105 |
118 } | 106 } |
119 | 107 |
120 static bool isDefinite(ProcessingUserGestureState state) | 108 static bool isDefinite(ProcessingUserGestureState state) |
121 { | 109 { |
122 return state == DefinitelyProcessingNewUserGesture || state == DefinitelyPro
cessingUserGesture || state == DefinitelyNotProcessingUserGesture; | 110 return state == DefinitelyProcessingNewUserGesture || state == DefinitelyPro
cessingUserGesture || state == DefinitelyNotProcessingUserGesture; |
123 } | 111 } |
124 | 112 |
125 ProcessingUserGestureState UserGestureIndicator::s_state = DefinitelyNotProcessi
ngUserGesture; | 113 ProcessingUserGestureState UserGestureIndicator::s_state = DefinitelyNotProcessi
ngUserGesture; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 221 } |
234 | 222 |
235 UserGestureIndicatorDisabler::~UserGestureIndicatorDisabler() | 223 UserGestureIndicatorDisabler::~UserGestureIndicatorDisabler() |
236 { | 224 { |
237 RELEASE_ASSERT(isMainThread()); | 225 RELEASE_ASSERT(isMainThread()); |
238 UserGestureIndicator::s_state = m_savedState; | 226 UserGestureIndicator::s_state = m_savedState; |
239 UserGestureIndicator::s_topmostIndicator = m_savedIndicator; | 227 UserGestureIndicator::s_topmostIndicator = m_savedIndicator; |
240 } | 228 } |
241 | 229 |
242 } | 230 } |
OLD | NEW |