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 |
91 private: | 101 private: |
92 GestureToken() | 102 GestureToken() |
93 : m_consumableGestures(0), | 103 : m_consumableGestures(0), |
94 m_timestamp(0), | 104 m_timestamp(0), |
95 m_outOfProcess(false), | 105 m_outOfProcess(false), |
96 m_javascriptPrompt(false) | 106 m_javascriptPrompt(false), |
| 107 m_forwarded(false) |
97 { | 108 { |
98 } | 109 } |
99 | 110 |
100 size_t m_consumableGestures; | 111 size_t m_consumableGestures; |
101 double m_timestamp; | 112 double m_timestamp; |
102 bool m_outOfProcess; | 113 bool m_outOfProcess; |
103 bool m_javascriptPrompt; | 114 bool m_javascriptPrompt; |
| 115 bool m_forwarded; |
104 }; | 116 }; |
105 | 117 |
106 } | 118 } |
107 | 119 |
108 static bool isDefinite(ProcessingUserGestureState state) | 120 static bool isDefinite(ProcessingUserGestureState state) |
109 { | 121 { |
110 return state == DefinitelyProcessingNewUserGesture || state == DefinitelyPro
cessingUserGesture || state == DefinitelyNotProcessingUserGesture; | 122 return state == DefinitelyProcessingNewUserGesture || state == DefinitelyPro
cessingUserGesture || state == DefinitelyNotProcessingUserGesture; |
111 } | 123 } |
112 | 124 |
113 ProcessingUserGestureState UserGestureIndicator::s_state = DefinitelyNotProcessi
ngUserGesture; | 125 ProcessingUserGestureState UserGestureIndicator::s_state = DefinitelyNotProcessi
ngUserGesture; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 } | 233 } |
222 | 234 |
223 UserGestureIndicatorDisabler::~UserGestureIndicatorDisabler() | 235 UserGestureIndicatorDisabler::~UserGestureIndicatorDisabler() |
224 { | 236 { |
225 RELEASE_ASSERT(isMainThread()); | 237 RELEASE_ASSERT(isMainThread()); |
226 UserGestureIndicator::s_state = m_savedState; | 238 UserGestureIndicator::s_state = m_savedState; |
227 UserGestureIndicator::s_topmostIndicator = m_savedIndicator; | 239 UserGestureIndicator::s_topmostIndicator = m_savedIndicator; |
228 } | 240 } |
229 | 241 |
230 } | 242 } |
OLD | NEW |