Changes Controller to use Tab.getUrl in more places

 Bug: 3342456
 Changes Controller to use Tab.getUrl() and then added empty
 url checks in places like doUpdateVisitedHistory. Tab already takes
 care of filtering URLs, so filtering out most visited URLs is thus
 handled.

Change-Id: Iaf60353d7cb924991c5e0a5adf18074fcf13bfe6
diff --git a/src/com/android/browser/UrlUtils.java b/src/com/android/browser/UrlUtils.java
index 2df0a61..72ac37b 100644
--- a/src/com/android/browser/UrlUtils.java
+++ b/src/com/android/browser/UrlUtils.java
@@ -16,6 +16,8 @@
 
 package com.android.browser;
 
+import com.android.browser.homepages.HomeProvider;
+
 import android.net.Uri;
 import android.util.Patterns;
 import android.webkit.URLUtil;
@@ -145,4 +147,15 @@
         return inUrl;
     }
 
+    // Returns the filtered URL. Cannot return null, but can return an empty string
+    /* package */ static String filteredUrl(String inUrl) {
+        if (inUrl == null) {
+            return "";
+        }
+        if (inUrl.startsWith(HomeProvider.MOST_VISITED)) {
+            return "";
+        }
+        return inUrl;
+    }
+
 }