Bug 463474 - Make sanitizer's searchbar clearing code a bit cleaner; r=gavin a191=beltzner
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Fri, 28 Nov 2008 12:51:16 -0800
changeset 22098 b7fda2af9255124616b9708f6cdbcf034381d593
parent 22097 169f2cc23290f64465169635768558d01ca6e804
child 22099 73d9cfe0174ce9bf41a2aa387dac7fbb68810f06
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersgavin
bugs463474
milestone1.9.1b3pre
Bug 463474 - Make sanitizer's searchbar clearing code a bit cleaner; r=gavin a191=beltzner
browser/base/content/sanitize.js
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -217,20 +217,18 @@ Sanitizer.prototype = {
       clear: function ()
       {
         // Clear undo history of all searchBars
         var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1']
                                       .getService(Components.interfaces.nsIWindowMediator);
         var windows = windowManager.getEnumerator("navigator:browser");
         while (windows.hasMoreElements()) {
           var searchBar = windows.getNext().document.getElementById("searchbar");
-          if (searchBar) {
-            searchBar.value = "";
-            searchBar.textbox.editor.transactionManager.clear();
-          }
+          if (searchBar)
+            searchBar.textbox.reset();
         }
 
         var formHistory = Components.classes["@mozilla.org/satchel/form-history;1"]
                                     .getService(Components.interfaces.nsIFormHistory2);
         if (this.range)
           formHistory.removeEntriesByTimeframe(this.range[0], this.range[1]);
         else
           formHistory.removeAllEntries();