Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(959)

Unified Diff: Source/web/PopupMenuImpl.cpp

Issue 1159833003: New SELECT Popup: Recalc style when a web font is loaded (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/PopupMenuImpl.cpp
diff --git a/Source/web/PopupMenuImpl.cpp b/Source/web/PopupMenuImpl.cpp
index 621fa5861f7ba0bfafd4e98ebfe7de003ec4a800..d76f4bdffb0eb4e6006bb0d81909535220590c02 100644
--- a/Source/web/PopupMenuImpl.cpp
+++ b/Source/web/PopupMenuImpl.cpp
@@ -27,17 +27,21 @@
namespace blink {
-class PopupMenuCSSFontSelector : public CSSFontSelector {
+class PopupMenuCSSFontSelector : public CSSFontSelector, public CSSFontSelectorClient {
tkent 2015/05/29 05:41:03 public CSSFontSelectorClient -> private CSSFontSel
public:
static PassRefPtrWillBeRawPtr<PopupMenuCSSFontSelector> create(Document* document, CSSFontSelector* ownerFontSelector)
{
return adoptRefWillBeNoop(new PopupMenuCSSFontSelector(document, ownerFontSelector));
}
+ ~PopupMenuCSSFontSelector();
+
// We don't override willUseFontData() for now because the old PopupListBox
// only worked with fonts loaded when opening the popup.
virtual PassRefPtr<FontData> getFontData(const FontDescription&, const AtomicString&) override;
+ virtual void fontsNeedUpdate(CSSFontSelector*) override;
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -45,19 +49,30 @@ private:
: CSSFontSelector(document)
, m_ownerFontSelector(ownerFontSelector)
{
+ m_ownerFontSelector->registerForInvalidationCallbacks(this);
}
RefPtrWillBeMember<CSSFontSelector> m_ownerFontSelector;
};
+PopupMenuCSSFontSelector::~PopupMenuCSSFontSelector()
+{
Kunihiko Sakamoto 2015/05/29 05:57:35 Don't we need to unregister from m_ownerFontSelect
keishi 2015/05/29 07:30:51 Done.
+}
+
PassRefPtr<FontData> PopupMenuCSSFontSelector::getFontData(const FontDescription& description, const AtomicString& name)
{
return m_ownerFontSelector->getFontData(description, name);
}
+void PopupMenuCSSFontSelector::fontsNeedUpdate(CSSFontSelector* fontSelector)
+{
+ dispatchInvalidationCallbacks();
+}
+
DEFINE_TRACE(PopupMenuCSSFontSelector)
{
visitor->trace(m_ownerFontSelector);
CSSFontSelector::trace(visitor);
+ CSSFontSelectorClient::trace(visitor);
}
PassRefPtrWillBeRawPtr<PopupMenuImpl> PopupMenuImpl::create(ChromeClientImpl* chromeClient, PopupMenuClient* client)

Powered by Google App Engine
This is Rietveld 408576698