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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 { | 475 { |
476 if (m_popup) | 476 if (m_popup) |
477 m_chromeClient->closePagePopup(m_popup); | 477 m_chromeClient->closePagePopup(m_popup); |
478 } | 478 } |
479 | 479 |
480 void PopupMenuImpl::updateFromElement() | 480 void PopupMenuImpl::updateFromElement() |
481 { | 481 { |
482 if (m_needsUpdate) | 482 if (m_needsUpdate) |
483 return; | 483 return; |
484 m_needsUpdate = true; | 484 m_needsUpdate = true; |
485 ownerElement().document().postTask(FROM_HERE, createSameThreadTask(&PopupMen
uImpl::update, PassRefPtrWillBeRawPtr<PopupMenuImpl>(this))); | 485 ownerElement().document().postTask(BLINK_FROM_HERE, createSameThreadTask(&Po
pupMenuImpl::update, PassRefPtrWillBeRawPtr<PopupMenuImpl>(this))); |
486 } | 486 } |
487 | 487 |
488 void PopupMenuImpl::update() | 488 void PopupMenuImpl::update() |
489 { | 489 { |
490 if (!m_popup || !m_ownerElement) | 490 if (!m_popup || !m_ownerElement) |
491 return; | 491 return; |
492 ownerElement().document().updateLayoutTreeIfNeeded(); | 492 ownerElement().document().updateLayoutTreeIfNeeded(); |
493 // disconnectClient() might have been called. | 493 // disconnectClient() might have been called. |
494 if (!m_ownerElement) | 494 if (!m_ownerElement) |
495 return; | 495 return; |
(...skipping 25 matching lines...) Expand all Loading... |
521 | 521 |
522 void PopupMenuImpl::disconnectClient() | 522 void PopupMenuImpl::disconnectClient() |
523 { | 523 { |
524 m_ownerElement = nullptr; | 524 m_ownerElement = nullptr; |
525 // Cannot be done during finalization, so instead done when the | 525 // Cannot be done during finalization, so instead done when the |
526 // layout object is destroyed and disconnected. | 526 // layout object is destroyed and disconnected. |
527 dispose(); | 527 dispose(); |
528 } | 528 } |
529 | 529 |
530 } // namespace blink | 530 } // namespace blink |
OLD | NEW |