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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 addOption(context, toHTMLOptionElement(child)); | 287 addOption(context, toHTMLOptionElement(child)); |
| 288 else if (isHTMLOptGroupElement(child)) | 288 else if (isHTMLOptGroupElement(child)) |
| 289 addOptGroup(context, toHTMLOptGroupElement(child)); | 289 addOptGroup(context, toHTMLOptGroupElement(child)); |
| 290 else if (isHTMLHRElement(child)) | 290 else if (isHTMLHRElement(child)) |
| 291 addSeparator(context, toHTMLHRElement(child)); | 291 addSeparator(context, toHTMLHRElement(child)); |
| 292 } | 292 } |
| 293 context.finishGroupIfNecessary(); | 293 context.finishGroupIfNecessary(); |
| 294 PagePopupClient::addString("],\n", data); | 294 PagePopupClient::addString("],\n", data); |
| 295 | 295 |
| 296 addProperty("anchorRectInScreen", anchorRectInScreen, data); | 296 addProperty("anchorRectInScreen", anchorRectInScreen, data); |
| 297 IntRect inScreen = m_chromeClient->viewportToScreen(IntRect(0, 0, 100, 0)); | |
| 298 float scaleFactor = 100.f / inScreen.width(); | |
| 299 addProperty("scaleFactor", scaleFactor, data); | |
|
tkent
2015/11/18 07:06:39
I agree that we need to pass scale-factor in addit
| |
| 297 bool isRTL = !ownerStyle->isLeftToRightDirection(); | 300 bool isRTL = !ownerStyle->isLeftToRightDirection(); |
| 298 addProperty("isRTL", isRTL, data); | 301 addProperty("isRTL", isRTL, data); |
| 299 addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDoub le() : ownerElement.clientPaddingLeft().toDouble(), data); | 302 addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDoub le() : ownerElement.clientPaddingLeft().toDouble(), data); |
| 300 PagePopupClient::addString("};\n", data); | 303 PagePopupClient::addString("};\n", data); |
| 301 data->append(Platform::current()->loadResource("pickerCommon.js")); | 304 data->append(Platform::current()->loadResource("pickerCommon.js")); |
| 302 data->append(Platform::current()->loadResource("listPicker.js")); | 305 data->append(Platform::current()->loadResource("listPicker.js")); |
| 303 PagePopupClient::addString("</script></body>\n", data); | 306 PagePopupClient::addString("</script></body>\n", data); |
| 304 } | 307 } |
| 305 | 308 |
| 306 void PopupMenuImpl::addElementStyle(ItemIterationContext& context, HTMLElement& element) | 309 void PopupMenuImpl::addElementStyle(ItemIterationContext& context, HTMLElement& element) |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 | 524 |
| 522 void PopupMenuImpl::disconnectClient() | 525 void PopupMenuImpl::disconnectClient() |
| 523 { | 526 { |
| 524 m_ownerElement = nullptr; | 527 m_ownerElement = nullptr; |
| 525 // Cannot be done during finalization, so instead done when the | 528 // Cannot be done during finalization, so instead done when the |
| 526 // layout object is destroyed and disconnected. | 529 // layout object is destroyed and disconnected. |
| 527 dispose(); | 530 dispose(); |
| 528 } | 531 } |
| 529 | 532 |
| 530 } // namespace blink | 533 } // namespace blink |
| OLD | NEW |