Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c8d886b authored by Leon Clarke's avatar Leon Clarke
Browse files

Coloring clicked-on links

Following review comments

Merging in ben's change

Whitespace
parent 9251c344
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -273,6 +273,32 @@ public class Browser {
        }
    }

    /**
     *  Returns all the URLs in the history.
     *  Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
     *  @param cr   The ContentResolver used to access the database.
     *  @hide pending API council approval
     */
    public static final String[] getVisitedHistory(ContentResolver cr) {
	try {
	    String[] projection = new String[] { "url" };
	    Cursor c = cr.query(BOOKMARKS_URI,
				projection,
				"visits > 0",
				null, null);
	    String[] str = new String[c.getCount()];
	    int i = 0;
	    while (c.moveToNext()) {
		str[i] = c.getString(0);
		i++;
	    }
	    c.deactivate();
	    return str;
	} catch (IllegalStateException e) {
	    return new String[0];
	}
    }

    /**
     * If there are more than MAX_HISTORY_COUNT non-bookmark history
     * items in the bookmark/history table, delete TRUNCATE_N_OLDEST
+5 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.provider.Browser;
import android.util.Log;
import android.util.SparseBooleanArray;
import android.view.KeyEvent;
@@ -310,6 +311,10 @@ final class WebViewCore {
                });
    }

    protected String[] populateVisitedLinks() {
	return Browser.getVisitedHistory(mContext.getContentResolver());
    }

    /**
     * Shows a prompt to ask the user to set the Geolocation permission state
     * for the given origin.