| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 m_listBox->updateFromElement(); | 399 m_listBox->updateFromElement(); |
| 400 | 400 |
| 401 // We set the selected item in updateFromElement(), and disregard the | 401 // We set the selected item in updateFromElement(), and disregard the |
| 402 // index passed into this function (same as Webkit's PopupMenuWin.cpp) | 402 // index passed into this function (same as Webkit's PopupMenuWin.cpp) |
| 403 // FIXME: make sure this is correct, and add an assertion. | 403 // FIXME: make sure this is correct, and add an assertion. |
| 404 // ASSERT(popupWindow(popup)->listBox()->selectedIndex() == index); | 404 // ASSERT(popupWindow(popup)->listBox()->selectedIndex() == index); |
| 405 | 405 |
| 406 // Save and convert the controlPosition to main window coords. Each point is
converted separately | 406 // Save and convert the controlPosition to main window coords. Each point is
converted separately |
| 407 // to window coordinates because the control could be in a transformed webvi
ew and then each point | 407 // to window coordinates because the control could be in a transformed webvi
ew and then each point |
| 408 // would be transformed by a different delta. | 408 // would be transformed by a different delta. |
| 409 m_controlPosition.setP1(v->contentsToWindow(IntPoint(controlPosition.p1().x(
), controlPosition.p1().y()))); | 409 m_controlPosition.setP1(v->contentsToRootFrame(IntPoint(controlPosition.p1()
.x(), controlPosition.p1().y()))); |
| 410 m_controlPosition.setP2(v->contentsToWindow(IntPoint(controlPosition.p2().x(
), controlPosition.p2().y()))); | 410 m_controlPosition.setP2(v->contentsToRootFrame(IntPoint(controlPosition.p2()
.x(), controlPosition.p2().y()))); |
| 411 m_controlPosition.setP3(v->contentsToWindow(IntPoint(controlPosition.p3().x(
), controlPosition.p3().y()))); | 411 m_controlPosition.setP3(v->contentsToRootFrame(IntPoint(controlPosition.p3()
.x(), controlPosition.p3().y()))); |
| 412 m_controlPosition.setP4(v->contentsToWindow(IntPoint(controlPosition.p4().x(
), controlPosition.p4().y()))); | 412 m_controlPosition.setP4(v->contentsToRootFrame(IntPoint(controlPosition.p4()
.x(), controlPosition.p4().y()))); |
| 413 | 413 |
| 414 FloatRect controlBounds = m_controlPosition.boundingBox(); | 414 FloatRect controlBounds = m_controlPosition.boundingBox(); |
| 415 controlBounds.moveBy(-v->page()->frameHost().pinchViewport().location()); | 415 controlBounds = v->page()->frameHost().pinchViewport().mainViewToViewportCSS
Pixels(controlBounds); |
| 416 m_controlPosition = controlBounds; | 416 m_controlPosition = controlBounds; |
| 417 | 417 |
| 418 m_controlSize = controlSize; | 418 m_controlSize = controlSize; |
| 419 | 419 |
| 420 // Position at (0, 0) since the frameRect().location() is relative to the | 420 // Position at (0, 0) since the frameRect().location() is relative to the |
| 421 // parent WebWidget. | 421 // parent WebWidget. |
| 422 setFrameRect(IntRect(IntPoint(), controlSize)); | 422 setFrameRect(IntRect(IntPoint(), controlSize)); |
| 423 showPopup(v); | 423 showPopup(v); |
| 424 } | 424 } |
| 425 | 425 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 } | 493 } |
| 494 | 494 |
| 495 IntPoint PopupContainer::convertSelfToChild(const Widget* child, const IntPoint&
point) const | 495 IntPoint PopupContainer::convertSelfToChild(const Widget* child, const IntPoint&
point) const |
| 496 { | 496 { |
| 497 IntPoint newPoint = point; | 497 IntPoint newPoint = point; |
| 498 newPoint.moveBy(-child->location()); | 498 newPoint.moveBy(-child->location()); |
| 499 return newPoint; | 499 return newPoint; |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace blink | 502 } // namespace blink |
| OLD | NEW |