Chromium Code Reviews| 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 "config.h" | 5 #include "config.h" |
| 6 #include "web/PopupMenuImpl.h" | 6 #include "web/PopupMenuImpl.h" |
| 7 | 7 |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
| 9 #include "core/css/CSSFontSelector.h" | 9 #include "core/css/CSSFontSelector.h" |
| 10 #include "core/dom/ElementTraversal.h" | 10 #include "core/dom/ElementTraversal.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 if (isHTMLOptionElement(child)) | 282 if (isHTMLOptionElement(child)) |
| 283 addOption(context, toHTMLOptionElement(child)); | 283 addOption(context, toHTMLOptionElement(child)); |
| 284 else if (isHTMLOptGroupElement(child)) | 284 else if (isHTMLOptGroupElement(child)) |
| 285 addOptGroup(context, toHTMLOptGroupElement(child)); | 285 addOptGroup(context, toHTMLOptGroupElement(child)); |
| 286 else if (isHTMLHRElement(child)) | 286 else if (isHTMLHRElement(child)) |
| 287 addSeparator(context, toHTMLHRElement(child)); | 287 addSeparator(context, toHTMLHRElement(child)); |
| 288 } | 288 } |
| 289 context.finishGroupIfNecessary(); | 289 context.finishGroupIfNecessary(); |
| 290 PagePopupClient::addString("],\n", data); | 290 PagePopupClient::addString("],\n", data); |
| 291 | 291 |
| 292 addProperty("anchorRectInScreen", anchorRectInScreen, data); | |
| 292 float zoom = zoomFactor(); | 293 float zoom = zoomFactor(); |
| 293 addProperty("anchorRectInScreen", anchorRectInScreen, data); | 294 IntRect inScreen = m_chromeClient->viewportToScreen(IntRect(0, 0, 100, 0)); |
|
oshima
2015/12/08 21:21:32
Please let me know if you prefer to add a separate
| |
| 294 addProperty("zoomFactor", zoom, data); | 295 float scaleFactor = 100.f / inScreen.width(); |
| 296 addProperty("zoomFactor", zoom / scaleFactor, data); | |
|
oshima
2015/12/08 21:21:32
Please let me know if you prefer to rename zoomFac
| |
| 295 bool isRTL = !ownerStyle->isLeftToRightDirection(); | 297 bool isRTL = !ownerStyle->isLeftToRightDirection(); |
| 296 addProperty("isRTL", isRTL, data); | 298 addProperty("isRTL", isRTL, data); |
| 297 addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDoub le() / zoom : ownerElement.clientPaddingLeft().toDouble() / zoom, data); | 299 addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDoub le() / zoom : ownerElement.clientPaddingLeft().toDouble() / zoom, data); |
| 298 PagePopupClient::addString("};\n", data); | 300 PagePopupClient::addString("};\n", data); |
| 299 data->append(Platform::current()->loadResource("pickerCommon.js")); | 301 data->append(Platform::current()->loadResource("pickerCommon.js")); |
| 300 data->append(Platform::current()->loadResource("listPicker.js")); | 302 data->append(Platform::current()->loadResource("listPicker.js")); |
| 301 PagePopupClient::addString("</script></body>\n", data); | 303 PagePopupClient::addString("</script></body>\n", data); |
| 302 } | 304 } |
| 303 | 305 |
| 304 void PopupMenuImpl::addElementStyle(ItemIterationContext& context, HTMLElement& element) | 306 void PopupMenuImpl::addElementStyle(ItemIterationContext& context, HTMLElement& element) |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 522 | 524 |
| 523 void PopupMenuImpl::disconnectClient() | 525 void PopupMenuImpl::disconnectClient() |
| 524 { | 526 { |
| 525 m_ownerElement = nullptr; | 527 m_ownerElement = nullptr; |
| 526 // Cannot be done during finalization, so instead done when the | 528 // Cannot be done during finalization, so instead done when the |
| 527 // layout object is destroyed and disconnected. | 529 // layout object is destroyed and disconnected. |
| 528 dispose(); | 530 dispose(); |
| 529 } | 531 } |
| 530 | 532 |
| 531 } // namespace blink | 533 } // namespace blink |
| OLD | NEW |