summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderSearchField.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderSearchField.h')
-rw-r--r--Source/WebCore/rendering/RenderSearchField.h82
1 files changed, 41 insertions, 41 deletions
diff --git a/Source/WebCore/rendering/RenderSearchField.h b/Source/WebCore/rendering/RenderSearchField.h
index 436561c17..4c2d3fa8e 100644
--- a/Source/WebCore/rendering/RenderSearchField.h
+++ b/Source/WebCore/rendering/RenderSearchField.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2009, 2015 Apple Inc. All rights reserved.
* Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
@@ -20,20 +20,19 @@
*
*/
-#ifndef RenderSearchField_h
-#define RenderSearchField_h
+#pragma once
#include "PopupMenuClient.h"
#include "RenderTextControlSingleLine.h"
+#include "SearchPopupMenu.h"
namespace WebCore {
class HTMLInputElement;
-class SearchPopupMenu;
class RenderSearchField final : public RenderTextControlSingleLine, private PopupMenuClient {
public:
- RenderSearchField(HTMLInputElement&, PassRef<RenderStyle>);
+ RenderSearchField(HTMLInputElement&, RenderStyle&&);
virtual ~RenderSearchField();
void updateCancelButtonVisibility() const;
@@ -46,52 +45,53 @@ public:
void hidePopup();
private:
- virtual void centerContainerIfNeeded(RenderBox*) const override;
- virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const override;
- virtual LayoutUnit computeLogicalHeightLimit() const override;
- virtual void updateFromElement() override;
+ bool isSearchField() const final { return true; }
+
+ void willBeDestroyed() override;
+ void centerContainerIfNeeded(RenderBox*) const override;
+ LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const override;
+ LayoutUnit computeLogicalHeightLimit() const override;
+ void updateFromElement() override;
EVisibility visibilityForCancelButton() const;
const AtomicString& autosaveName() const;
// PopupMenuClient methods
- virtual void valueChanged(unsigned listIndex, bool fireEvents = true) override;
- virtual void selectionChanged(unsigned, bool) override { }
- virtual void selectionCleared() override { }
- virtual String itemText(unsigned listIndex) const override;
- virtual String itemLabel(unsigned listIndex) const override;
- virtual String itemIcon(unsigned listIndex) const override;
- virtual String itemToolTip(unsigned) const override { return String(); }
- virtual String itemAccessibilityText(unsigned) const override { return String(); }
- virtual bool itemIsEnabled(unsigned listIndex) const override;
- virtual PopupMenuStyle itemStyle(unsigned listIndex) const override;
- virtual PopupMenuStyle menuStyle() const override;
- virtual int clientInsetLeft() const override;
- virtual int clientInsetRight() const override;
- virtual LayoutUnit clientPaddingLeft() const override;
- virtual LayoutUnit clientPaddingRight() const override;
- virtual int listSize() const override;
- virtual int selectedIndex() const override;
- virtual void popupDidHide() override;
- virtual bool itemIsSeparator(unsigned listIndex) const override;
- virtual bool itemIsLabel(unsigned listIndex) const override;
- virtual bool itemIsSelected(unsigned listIndex) const override;
- virtual bool shouldPopOver() const override { return false; }
- virtual bool valueShouldChangeOnHotTrack() const override { return false; }
- virtual void setTextFromItem(unsigned listIndex) override;
- virtual FontSelector* fontSelector() const override;
- virtual HostWindow* hostWindow() const override;
- virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize) override;
+ void valueChanged(unsigned listIndex, bool fireEvents = true) override;
+ void selectionChanged(unsigned, bool) override { }
+ void selectionCleared() override { }
+ String itemText(unsigned listIndex) const override;
+ String itemLabel(unsigned listIndex) const override;
+ String itemIcon(unsigned listIndex) const override;
+ String itemToolTip(unsigned) const override { return String(); }
+ String itemAccessibilityText(unsigned) const override { return String(); }
+ bool itemIsEnabled(unsigned listIndex) const override;
+ PopupMenuStyle itemStyle(unsigned listIndex) const override;
+ PopupMenuStyle menuStyle() const override;
+ int clientInsetLeft() const override;
+ int clientInsetRight() const override;
+ LayoutUnit clientPaddingLeft() const override;
+ LayoutUnit clientPaddingRight() const override;
+ int listSize() const override;
+ int selectedIndex() const override;
+ void popupDidHide() override;
+ bool itemIsSeparator(unsigned listIndex) const override;
+ bool itemIsLabel(unsigned listIndex) const override;
+ bool itemIsSelected(unsigned listIndex) const override;
+ bool shouldPopOver() const override { return false; }
+ bool valueShouldChangeOnHotTrack() const override { return false; }
+ void setTextFromItem(unsigned listIndex) override;
+ FontSelector* fontSelector() const override;
+ HostWindow* hostWindow() const override;
+ Ref<Scrollbar> createScrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize) override;
HTMLElement* resultsButtonElement() const;
HTMLElement* cancelButtonElement() const;
bool m_searchPopupIsVisible;
RefPtr<SearchPopupMenu> m_searchPopup;
- Vector<String> m_recentSearches;
+ Vector<RecentSearch> m_recentSearches;
};
-RENDER_OBJECT_TYPE_CASTS(RenderSearchField, isTextField())
-
-}
+} // namespace WebCore
-#endif
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSearchField, isSearchField())