OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 void WebViewImpl::refreshAutofillPopup() | 3097 void WebViewImpl::refreshAutofillPopup() |
3098 { | 3098 { |
3099 ASSERT(m_autofillPopupShowing); | 3099 ASSERT(m_autofillPopupShowing); |
3100 | 3100 |
3101 // Hide the popup if it has become empty. | 3101 // Hide the popup if it has become empty. |
3102 if (!m_autofillPopupClient->listSize()) { | 3102 if (!m_autofillPopupClient->listSize()) { |
3103 hideAutofillPopup(); | 3103 hideAutofillPopup(); |
3104 return; | 3104 return; |
3105 } | 3105 } |
3106 | 3106 |
3107 IntRect oldBounds = m_autofillPopup->frameRect(); | 3107 WebRect newWidgetRect = m_autofillPopup->refresh(focusedWebCoreNode()->getPi
xelSnappedRect()); |
3108 m_autofillPopup->refresh(focusedWebCoreNode()->getPixelSnappedRect()); | |
3109 IntRect newBounds = m_autofillPopup->frameRect(); | |
3110 // Let's resize the backing window if necessary. | 3108 // Let's resize the backing window if necessary. |
3111 if (oldBounds != newBounds) { | 3109 WebPopupMenuImpl* popupMenu = static_cast<WebPopupMenuImpl*>(m_autofillPopup
->client()); |
3112 WebPopupMenuImpl* popupMenu = | 3110 if (popupMenu && popupMenu->client()->windowRect() != newWidgetRect) |
3113 static_cast<WebPopupMenuImpl*>(m_autofillPopup->client()); | 3111 popupMenu->client()->setWindowRect(newWidgetRect); |
3114 if (popupMenu) | |
3115 popupMenu->client()->setWindowRect(m_chromeClientImpl.rootViewToScre
en(newBounds)); | |
3116 } | |
3117 } | 3112 } |
3118 | 3113 |
3119 Node* WebViewImpl::focusedWebCoreNode() | 3114 Node* WebViewImpl::focusedWebCoreNode() |
3120 { | 3115 { |
3121 Frame* frame = m_page->focusController()->focusedFrame(); | 3116 Frame* frame = m_page->focusController()->focusedFrame(); |
3122 if (!frame) | 3117 if (!frame) |
3123 return 0; | 3118 return 0; |
3124 | 3119 |
3125 Document* document = frame->document(); | 3120 Document* document = frame->document(); |
3126 if (!document) | 3121 if (!document) |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3551 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); | 3546 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); |
3552 | 3547 |
3553 if (page()) | 3548 if (page()) |
3554 page()->pointerLockController()->dispatchLockedMouseEvent( | 3549 page()->pointerLockController()->dispatchLockedMouseEvent( |
3555 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), | 3550 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), |
3556 eventType); | 3551 eventType); |
3557 } | 3552 } |
3558 #endif | 3553 #endif |
3559 | 3554 |
3560 } // namespace WebKit | 3555 } // namespace WebKit |
OLD | NEW |