| 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 { | 476 { |
| 477 if (m_popup) | 477 if (m_popup) |
| 478 m_chromeClient->closePagePopup(m_popup); | 478 m_chromeClient->closePagePopup(m_popup); |
| 479 } | 479 } |
| 480 | 480 |
| 481 void PopupMenuImpl::updateFromElement() | 481 void PopupMenuImpl::updateFromElement() |
| 482 { | 482 { |
| 483 if (m_needsUpdate) | 483 if (m_needsUpdate) |
| 484 return; | 484 return; |
| 485 m_needsUpdate = true; | 485 m_needsUpdate = true; |
| 486 ownerElement().document().postTask(BLINK_FROM_HERE, createSameThreadTask(&Po
pupMenuImpl::update, this)); | 486 ownerElement().document().postTask(BLINK_FROM_HERE, createSameThreadTask(&Po
pupMenuImpl::update, retainedRef(this))); |
| 487 } | 487 } |
| 488 | 488 |
| 489 void PopupMenuImpl::update() | 489 void PopupMenuImpl::update() |
| 490 { | 490 { |
| 491 if (!m_popup || !m_ownerElement) | 491 if (!m_popup || !m_ownerElement) |
| 492 return; | 492 return; |
| 493 ownerElement().document().updateLayoutTree(); | 493 ownerElement().document().updateLayoutTree(); |
| 494 // disconnectClient() might have been called. | 494 // disconnectClient() might have been called. |
| 495 if (!m_ownerElement) | 495 if (!m_ownerElement) |
| 496 return; | 496 return; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 void PopupMenuImpl::disconnectClient() | 531 void PopupMenuImpl::disconnectClient() |
| 532 { | 532 { |
| 533 m_ownerElement = nullptr; | 533 m_ownerElement = nullptr; |
| 534 // Cannot be done during finalization, so instead done when the | 534 // Cannot be done during finalization, so instead done when the |
| 535 // layout object is destroyed and disconnected. | 535 // layout object is destroyed and disconnected. |
| 536 dispose(); | 536 dispose(); |
| 537 } | 537 } |
| 538 | 538 |
| 539 } // namespace blink | 539 } // namespace blink |
| OLD | NEW |