| 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 15 matching lines...) Expand all Loading... |
| 26 public: | 26 public: |
| 27 static PassRefPtrWillBeRawPtr<PopupMenuCSSFontSelector> create(Document* doc
ument, CSSFontSelector* ownerFontSelector) | 27 static PassRefPtrWillBeRawPtr<PopupMenuCSSFontSelector> create(Document* doc
ument, CSSFontSelector* ownerFontSelector) |
| 28 { | 28 { |
| 29 return adoptRefWillBeNoop(new PopupMenuCSSFontSelector(document, ownerFo
ntSelector)); | 29 return adoptRefWillBeNoop(new PopupMenuCSSFontSelector(document, ownerFo
ntSelector)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 // We don't override willUseFontData() for now because the old PopupListBox | 32 // We don't override willUseFontData() for now because the old PopupListBox |
| 33 // only worked with fonts loaded when opening the popup. | 33 // only worked with fonts loaded when opening the popup. |
| 34 virtual PassRefPtr<FontData> getFontData(const FontDescription&, const Atomi
cString&) override; | 34 virtual PassRefPtr<FontData> getFontData(const FontDescription&, const Atomi
cString&) override; |
| 35 | 35 |
| 36 virtual void trace(Visitor*) override; |
| 37 |
| 36 private: | 38 private: |
| 37 PopupMenuCSSFontSelector(Document* document, CSSFontSelector* ownerFontSelec
tor) | 39 PopupMenuCSSFontSelector(Document* document, CSSFontSelector* ownerFontSelec
tor) |
| 38 : CSSFontSelector(document) | 40 : CSSFontSelector(document) |
| 39 , m_ownerFontSelector(ownerFontSelector) { } | 41 , m_ownerFontSelector(ownerFontSelector) |
| 42 { |
| 43 } |
| 44 |
| 40 RefPtrWillBeMember<CSSFontSelector> m_ownerFontSelector; | 45 RefPtrWillBeMember<CSSFontSelector> m_ownerFontSelector; |
| 41 }; | 46 }; |
| 42 | 47 |
| 43 PassRefPtr<FontData> PopupMenuCSSFontSelector::getFontData(const FontDescription
& description, const AtomicString& name) | 48 PassRefPtr<FontData> PopupMenuCSSFontSelector::getFontData(const FontDescription
& description, const AtomicString& name) |
| 44 { | 49 { |
| 45 return m_ownerFontSelector->getFontData(description, name); | 50 return m_ownerFontSelector->getFontData(description, name); |
| 46 } | 51 } |
| 47 | 52 |
| 53 void PopupMenuCSSFontSelector::trace(Visitor* visitor) |
| 54 { |
| 55 visitor->trace(m_ownerFontSelector); |
| 56 CSSFontSelector::trace(visitor); |
| 57 } |
| 58 |
| 48 PassRefPtrWillBeRawPtr<PopupMenuImpl> PopupMenuImpl::create(ChromeClientImpl* ch
romeClient, PopupMenuClient* client) | 59 PassRefPtrWillBeRawPtr<PopupMenuImpl> PopupMenuImpl::create(ChromeClientImpl* ch
romeClient, PopupMenuClient* client) |
| 49 { | 60 { |
| 50 return adoptRefWillBeNoop(new PopupMenuImpl(chromeClient, client)); | 61 return adoptRefWillBeNoop(new PopupMenuImpl(chromeClient, client)); |
| 51 } | 62 } |
| 52 | 63 |
| 53 PopupMenuImpl::PopupMenuImpl(ChromeClientImpl* chromeClient, PopupMenuClient* cl
ient) | 64 PopupMenuImpl::PopupMenuImpl(ChromeClientImpl* chromeClient, PopupMenuClient* cl
ient) |
| 54 : m_chromeClient(chromeClient) | 65 : m_chromeClient(chromeClient) |
| 55 , m_client(client) | 66 , m_client(client) |
| 56 , m_popup(nullptr) | 67 , m_popup(nullptr) |
| 57 , m_indexToSetOnClose(-1) | 68 , m_indexToSetOnClose(-1) |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 #if ENABLE(OILPAN) | 301 #if ENABLE(OILPAN) |
| 291 // Cannot be done during finalization, so instead done when the | 302 // Cannot be done during finalization, so instead done when the |
| 292 // render object is destroyed and disconnected. | 303 // render object is destroyed and disconnected. |
| 293 // | 304 // |
| 294 // FIXME: do this always, regardless of ENABLE(OILPAN). | 305 // FIXME: do this always, regardless of ENABLE(OILPAN). |
| 295 dispose(); | 306 dispose(); |
| 296 #endif | 307 #endif |
| 297 } | 308 } |
| 298 | 309 |
| 299 } // namespace blink | 310 } // namespace blink |
| OLD | NEW |