| OLD | NEW |
| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 else if (isHTMLOptGroupElement(child)) | 283 else if (isHTMLOptGroupElement(child)) |
| 284 addOptGroup(context, toHTMLOptGroupElement(child)); | 284 addOptGroup(context, toHTMLOptGroupElement(child)); |
| 285 else if (isHTMLHRElement(child)) | 285 else if (isHTMLHRElement(child)) |
| 286 addSeparator(context, toHTMLHRElement(child)); | 286 addSeparator(context, toHTMLHRElement(child)); |
| 287 } | 287 } |
| 288 context.finishGroupIfNecessary(); | 288 context.finishGroupIfNecessary(); |
| 289 PagePopupClient::addString("],\n", data); | 289 PagePopupClient::addString("],\n", data); |
| 290 | 290 |
| 291 addProperty("anchorRectInScreen", anchorRectInScreen, data); | 291 addProperty("anchorRectInScreen", anchorRectInScreen, data); |
| 292 float zoom = zoomFactor(); | 292 float zoom = zoomFactor(); |
| 293 float scaleFactor = m_chromeClient->windowToViewport(FloatRect(0, 0, 1.0f, 0
)).width(); | 293 float scaleFactor = m_chromeClient->windowToViewportScalar(1.f); |
| 294 addProperty("zoomFactor", zoom / scaleFactor, data); | 294 addProperty("zoomFactor", zoom / scaleFactor, data); |
| 295 bool isRTL = !ownerStyle->isLeftToRightDirection(); | 295 bool isRTL = !ownerStyle->isLeftToRightDirection(); |
| 296 addProperty("isRTL", isRTL, data); | 296 addProperty("isRTL", isRTL, data); |
| 297 addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDoub
le() / zoom : ownerElement.clientPaddingLeft().toDouble() / zoom, data); | 297 addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDoub
le() / zoom : ownerElement.clientPaddingLeft().toDouble() / zoom, data); |
| 298 PagePopupClient::addString("};\n", data); | 298 PagePopupClient::addString("};\n", data); |
| 299 data->append(Platform::current()->loadResource("pickerCommon.js")); | 299 data->append(Platform::current()->loadResource("pickerCommon.js")); |
| 300 data->append(Platform::current()->loadResource("listPicker.js")); | 300 data->append(Platform::current()->loadResource("listPicker.js")); |
| 301 PagePopupClient::addString("</script></body>\n", data); | 301 PagePopupClient::addString("</script></body>\n", data); |
| 302 } | 302 } |
| 303 | 303 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 | 535 |
| 536 void PopupMenuImpl::disconnectClient() | 536 void PopupMenuImpl::disconnectClient() |
| 537 { | 537 { |
| 538 m_ownerElement = nullptr; | 538 m_ownerElement = nullptr; |
| 539 // Cannot be done during finalization, so instead done when the | 539 // Cannot be done during finalization, so instead done when the |
| 540 // layout object is destroyed and disconnected. | 540 // layout object is destroyed and disconnected. |
| 541 dispose(); | 541 dispose(); |
| 542 } | 542 } |
| 543 | 543 |
| 544 } // namespace blink | 544 } // namespace blink |
| OLD | NEW |