Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: Source/web/PopupContainer.cpp

Issue 967213004: Removed FrameView's windowToContents and contentsToWindow methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/LinkHighlight.cpp ('k') | Source/web/PopupListBox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/web/LinkHighlight.cpp ('k') | Source/web/PopupListBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698