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

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

Issue 919423002: Audited and renamed uses of methods and variables named RootView (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase again Created 5 years, 10 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/ExternalPopupMenuTest.cpp ('k') | Source/web/PopupMenuImpl.cpp » ('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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 IntRect widgetRectInScreen; 200 IntRect widgetRectInScreen;
201 // If the popup would extend past the bottom of the screen, open upwards 201 // If the popup would extend past the bottom of the screen, open upwards
202 // instead. 202 // instead.
203 IntRect screen = screenAvailableRect(m_frameView.get()); 203 IntRect screen = screenAvailableRect(m_frameView.get());
204 // Use popupInitialCoordinate.x() + rightOffset because RTL position 204 // Use popupInitialCoordinate.x() + rightOffset because RTL position
205 // needs to be considered. 205 // needs to be considered.
206 float pageScaleFactor = m_frameView->frame().page()->pageScaleFactor(); 206 float pageScaleFactor = m_frameView->frame().page()->pageScaleFactor();
207 int popupX = round((popupInitialCoordinate.x() + rightOffset) * pageScaleFac tor); 207 int popupX = round((popupInitialCoordinate.x() + rightOffset) * pageScaleFac tor);
208 int popupY = round((popupInitialCoordinate.y() + verticalForRTLOffset) * pag eScaleFactor); 208 int popupY = round((popupInitialCoordinate.y() + verticalForRTLOffset) * pag eScaleFactor);
209 widgetRectInScreen = chromeClient().rootViewToScreen(IntRect(popupX, popupY, targetSize.width(), targetSize.height())); 209 widgetRectInScreen = chromeClient().viewportToScreen(IntRect(popupX, popupY, targetSize.width(), targetSize.height()));
210 210
211 // If we have multiple screens and the browser rect is in one screen, we 211 // If we have multiple screens and the browser rect is in one screen, we
212 // have to clip the window width to the screen width. 212 // have to clip the window width to the screen width.
213 // When clipping, we also need to set a maximum width for the list box. 213 // When clipping, we also need to set a maximum width for the list box.
214 IntRect windowRect = chromeClient().windowRect(); 214 IntRect windowRect = chromeClient().windowRect();
215 215
216 bool needToResizeView = false; 216 bool needToResizeView = false;
217 widgetRectInScreen = layoutAndCalculateWidgetRectInternal(widgetRectInScreen , targetControlHeight, windowRect, screen, isRTL, rtlOffset, verticalOffset, tra nsformOffset, m_listBox.get(), needToResizeView); 217 widgetRectInScreen = layoutAndCalculateWidgetRectInternal(widgetRectInScreen , targetControlHeight, windowRect, screen, isRTL, rtlOffset, verticalOffset, tra nsformOffset, m_listBox.get(), needToResizeView);
218 if (needToResizeView) 218 if (needToResizeView)
219 fitToListBox(); 219 fitToListBox();
(...skipping 273 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/ExternalPopupMenuTest.cpp ('k') | Source/web/PopupMenuImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698