| 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/StyleEngine.h" | 10 #include "core/dom/StyleEngine.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 closePopup(); | 74 closePopup(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 IntSize PopupMenuImpl::contentSize() | 77 IntSize PopupMenuImpl::contentSize() |
| 78 { | 78 { |
| 79 return IntSize(); | 79 return IntSize(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void PopupMenuImpl::writeDocument(SharedBuffer* data) | 82 void PopupMenuImpl::writeDocument(SharedBuffer* data) |
| 83 { | 83 { |
| 84 IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_client->elem
entRectRelativeToRootView()); | 84 IntRect anchorRectInScreen = m_chromeClient->viewportToScreen(m_client->elem
entRectRelativeToViewport()); |
| 85 | 85 |
| 86 PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><styl
e>\n", data); | 86 PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><styl
e>\n", data); |
| 87 data->append(Platform::current()->loadResource("pickerCommon.css")); | 87 data->append(Platform::current()->loadResource("pickerCommon.css")); |
| 88 data->append(Platform::current()->loadResource("listPicker.css")); | 88 data->append(Platform::current()->loadResource("listPicker.css")); |
| 89 PagePopupClient::addString("</style></head><body><div id=main>Loading...</di
v><script>\n" | 89 PagePopupClient::addString("</style></head><body><div id=main>Loading...</di
v><script>\n" |
| 90 "window.dialogArguments = {\n", data); | 90 "window.dialogArguments = {\n", data); |
| 91 addProperty("selectedIndex", m_client->selectedIndex(), data); | 91 addProperty("selectedIndex", m_client->selectedIndex(), data); |
| 92 PagePopupClient::addString("children: [\n", data); | 92 PagePopupClient::addString("children: [\n", data); |
| 93 for (HTMLElement& child : Traversal<HTMLElement>::childrenOf(ownerElement())
) { | 93 for (HTMLElement& child : Traversal<HTMLElement>::childrenOf(ownerElement())
) { |
| 94 if (isHTMLOptionElement(child)) | 94 if (isHTMLOptionElement(child)) |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 261 } |
| 262 | 262 |
| 263 void PopupMenuImpl::dispose() | 263 void PopupMenuImpl::dispose() |
| 264 { | 264 { |
| 265 closePopup(); | 265 closePopup(); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void PopupMenuImpl::show(const FloatQuad& /*controlPosition*/, const IntSize& /*
controlSize*/, int /*index*/) | 268 void PopupMenuImpl::show(const FloatQuad& /*controlPosition*/, const IntSize& /*
controlSize*/, int /*index*/) |
| 269 { | 269 { |
| 270 ASSERT(!m_popup); | 270 ASSERT(!m_popup); |
| 271 m_popup = m_chromeClient->openPagePopup(this, m_client->elementRectRelativeT
oRootView()); | 271 m_popup = m_chromeClient->openPagePopup(this); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void PopupMenuImpl::hide() | 274 void PopupMenuImpl::hide() |
| 275 { | 275 { |
| 276 if (m_popup) | 276 if (m_popup) |
| 277 m_chromeClient->closePagePopup(m_popup); | 277 m_chromeClient->closePagePopup(m_popup); |
| 278 } | 278 } |
| 279 | 279 |
| 280 void PopupMenuImpl::updateFromElement() | 280 void PopupMenuImpl::updateFromElement() |
| 281 { | 281 { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 303 #if ENABLE(OILPAN) | 303 #if ENABLE(OILPAN) |
| 304 // Cannot be done during finalization, so instead done when the | 304 // Cannot be done during finalization, so instead done when the |
| 305 // render object is destroyed and disconnected. | 305 // render object is destroyed and disconnected. |
| 306 // | 306 // |
| 307 // FIXME: do this always, regardless of ENABLE(OILPAN). | 307 // FIXME: do this always, regardless of ENABLE(OILPAN). |
| 308 dispose(); | 308 dispose(); |
| 309 #endif | 309 #endif |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace blink | 312 } // namespace blink |
| OLD | NEW |