Reviewed by Oliver.
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2007 20:43:14 +0000 (20:43 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2007 20:43:14 +0000 (20:43 +0000)
        Adding the ability to enable or disable a SearchPopupMenu.

        * platform/SearchPopupMenu.h:
        * platform/mac/SearchPopupMenuMac.mm: (WebCore::SearchPopupMenu::enabled):
        * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::showPopup):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20123 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/SearchPopupMenu.h
WebCore/platform/mac/SearchPopupMenuMac.mm
WebCore/rendering/RenderTextControl.cpp

index 5120c6f..0766840 100644 (file)
@@ -1,3 +1,13 @@
+2007-03-12  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Oliver.
+
+        Adding the ability to enable or disable a SearchPopupMenu.
+
+        * platform/SearchPopupMenu.h:
+        * platform/mac/SearchPopupMenuMac.mm: (WebCore::SearchPopupMenu::enabled):
+        * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::showPopup):
+
 2007-03-09  Rob Buis  <buis@kde.org>
 
         Reviewed by Nikolas Zimmermann.
index f4f100f..4c498f5 100644 (file)
@@ -35,6 +35,8 @@ public:
 
     void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems);
     void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems);
+
+    bool enabled();
     
 protected:
     SearchPopupMenu(PopupMenuClient* client);
index dd111c7..d2be65f 100644 (file)
@@ -34,6 +34,11 @@ static NSString* autosaveKey(const String& name)
     return [@"com.apple.WebKit.searchField:" stringByAppendingString:name];
 }
 
+bool SearchPopupMenu::enabled()
+{
+    return true;
+}
+
 void SearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
 {
     if (name.isEmpty())
index 04696da..5d60961 100644 (file)
@@ -865,6 +865,10 @@ void RenderTextControl::showPopup()
 
     if (!m_searchPopup)
         m_searchPopup = SearchPopupMenu::create(this);
+
+    if (!m_searchPopup->enabled())
+        return;
+    
     m_searchPopupIsVisible = true;
 
     const AtomicString& name = autosaveName();