diff options
| author | Cary Clark <cary@android.com> | 2010-11-12 16:18:31 -0500 |
|---|---|---|
| committer | Cary Clark <cary@android.com> | 2010-11-15 10:51:57 -0500 |
| commit | 438cced0716e328ab5e424e35b377d2dd686f46b (patch) | |
| tree | 2453ae1cab1786148aa30aa2e734d8edaa98e8cc /WebKit/android | |
| parent | ff1576a1bd6302d6c9988912d17e47f325242574 (diff) | |
| download | external_webkit-438cced0716e328ab5e424e35b377d2dd686f46b.zip external_webkit-438cced0716e328ab5e424e35b377d2dd686f46b.tar.gz external_webkit-438cced0716e328ab5e424e35b377d2dd686f46b.tar.bz2 | |
make the button state revert to normal
This moves the logic used to ensure that cursor rings
eventually go away after being tapped to buttons, so
that they too go back to their normal state after a short
period.
bug:2127333
Change-Id: Ia2e1d4b7f735581dbd88bf32b35fe5b24922ea11
Diffstat (limited to 'WebKit/android')
| -rw-r--r-- | WebKit/android/nav/WebView.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 894ebd3..8984755 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -274,21 +274,20 @@ void nativeRecordButtons(bool hasFocus, bool pressed, bool invalidate) // is selected. Container* end = m_viewImpl->m_buttons.end(); for (Container* ptr = m_viewImpl->m_buttons.begin(); ptr != end; ptr++) { - WebCore::RenderSkinAndroid::State state; + RenderSkinAndroid::State state = RenderSkinAndroid::kNormal; if (ptr->matches(cursor)) { cursorIsOnButton = true; // If the WebView is out of focus/window focus, set the state to // normal, but still keep track of the fact that the selected is a // button - if (!hasFocus) { - state = WebCore::RenderSkinAndroid::kNormal; - } else if (pressed || m_ring.m_isPressed) { - state = WebCore::RenderSkinAndroid::kPressed; - } else { - state = WebCore::RenderSkinAndroid::kFocused; + if (hasFocus) { + if (pressed || m_ring.m_isPressed) + state = RenderSkinAndroid::kPressed; + else if (SkTime::GetMSecs() < m_ringAnimationEnd + && m_ringAnimationEnd != UINT_MAX) { + state = RenderSkinAndroid::kFocused; + } } - } else { - state = WebCore::RenderSkinAndroid::kNormal; } ptr->updateFocusState(state); } |
