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

Side by Side Diff: third_party/WebKit/Source/web/PopupMenuImpl.cpp

Issue 2290233007: Move convertViewportToWindow and convertWindowToViewport from (Closed)
Patch Set: add client to WebSharedWorkerImpl Created 4 years, 2 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "web/PopupMenuImpl.h" 5 #include "web/PopupMenuImpl.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/css/CSSFontSelector.h" 8 #include "core/css/CSSFontSelector.h"
9 #include "core/dom/ElementTraversal.h" 9 #include "core/dom/ElementTraversal.h"
10 #include "core/dom/ExecutionContextTask.h" 10 #include "core/dom/ExecutionContextTask.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 else if (isHTMLOptGroupElement(child)) 269 else if (isHTMLOptGroupElement(child))
270 addOptGroup(context, toHTMLOptGroupElement(child)); 270 addOptGroup(context, toHTMLOptGroupElement(child));
271 else if (isHTMLHRElement(child)) 271 else if (isHTMLHRElement(child))
272 addSeparator(context, toHTMLHRElement(child)); 272 addSeparator(context, toHTMLHRElement(child));
273 } 273 }
274 context.finishGroupIfNecessary(); 274 context.finishGroupIfNecessary();
275 PagePopupClient::addString("],\n", data); 275 PagePopupClient::addString("],\n", data);
276 276
277 addProperty("anchorRectInScreen", anchorRectInScreen, data); 277 addProperty("anchorRectInScreen", anchorRectInScreen, data);
278 float zoom = zoomFactor(); 278 float zoom = zoomFactor();
279 float scaleFactor = m_chromeClient->windowToViewportScalar(1.f); 279 float scaleFactor = m_chromeClient->windowToViewportScalar(*ownerElement.doc ument().frame()->view(), 1.f);
280 addProperty("zoomFactor", zoom / scaleFactor, data); 280 addProperty("zoomFactor", zoom / scaleFactor, data);
281 bool isRTL = !ownerStyle->isLeftToRightDirection(); 281 bool isRTL = !ownerStyle->isLeftToRightDirection();
282 addProperty("isRTL", isRTL, data); 282 addProperty("isRTL", isRTL, data);
283 addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDoub le() / zoom : ownerElement.clientPaddingLeft().toDouble() / zoom, data); 283 addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDoub le() / zoom : ownerElement.clientPaddingLeft().toDouble() / zoom, data);
284 PagePopupClient::addString("};\n", data); 284 PagePopupClient::addString("};\n", data);
285 data->append(Platform::current()->loadResource("pickerCommon.js")); 285 data->append(Platform::current()->loadResource("pickerCommon.js"));
286 data->append(Platform::current()->loadResource("listPicker.js")); 286 data->append(Platform::current()->loadResource("listPicker.js"));
287 PagePopupClient::addString("</script></body>\n", data); 287 PagePopupClient::addString("</script></body>\n", data);
288 } 288 }
289 289
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 void PopupMenuImpl::disconnectClient() 526 void PopupMenuImpl::disconnectClient()
527 { 527 {
528 m_ownerElement = nullptr; 528 m_ownerElement = nullptr;
529 // Cannot be done during finalization, so instead done when the 529 // Cannot be done during finalization, so instead done when the
530 // layout object is destroyed and disconnected. 530 // layout object is destroyed and disconnected.
531 dispose(); 531 dispose();
532 } 532 }
533 533
534 } // namespace blink 534 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.cpp ('k') | third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698