Merge m-c to fig

This commit is contained in:
Lucas Rocha
2013-08-20 11:50:04 +01:00
131 changed files with 4458 additions and 1636 deletions

View File

@@ -55,7 +55,6 @@ public class Tab {
private boolean mBookmark;
private boolean mReadingListItem;
private long mFaviconLoadId;
private String mDocumentURI;
private String mContentType;
private boolean mHasTouchListeners;
private ZoomConstraints mZoomConstraints;
@@ -68,6 +67,7 @@ public class Tab {
private boolean mDesktopMode;
private boolean mEnteringReaderMode;
private Context mAppContext;
private ErrorType mErrorType = ErrorType.NONE;
private static final int MAX_HISTORY_LIST_SIZE = 50;
public static final int STATE_DELAYED = 0;
@@ -77,6 +77,13 @@ public class Tab {
private static final int DEFAULT_BACKGROUND_COLOR = Color.WHITE;
public enum ErrorType {
CERT_ERROR, // Pages with certificate problems
BLOCKED, // Pages blocked for phishing or malware warnings
NET_ERROR, // All other types of error
NONE // Non error pages
}
public Tab(Context context, int id, String url, boolean external, int parentId, String title) {
mAppContext = context.getApplicationContext();
mId = id;
@@ -101,7 +108,6 @@ public class Tab {
mBookmark = false;
mReadingListItem = false;
mFaviconLoadId = 0;
mDocumentURI = "";
mContentType = "";
mZoomConstraints = new ZoomConstraints(false);
mPluginViews = new ArrayList<View>();
@@ -274,12 +280,23 @@ public class Tab {
mUserSearch = userSearch;
}
public void setDocumentURI(String documentURI) {
mDocumentURI = documentURI;
public void setErrorType(String type) {
if ("blocked".equals(type))
setErrorType(ErrorType.BLOCKED);
else if ("certerror".equals(type))
setErrorType(ErrorType.CERT_ERROR);
else if ("neterror".equals(type))
setErrorType(ErrorType.NET_ERROR);
else
setErrorType(ErrorType.NONE);
}
public String getDocumentURI() {
return mDocumentURI;
public void setErrorType(ErrorType type) {
mErrorType = type;
}
public ErrorType getErrorType() {
return mErrorType;
}
public void setContentType(String contentType) {
@@ -588,7 +605,6 @@ public class Tab {
updateURL(uri);
updateUserSearch(message.getString("userSearch"));
setDocumentURI(message.getString("documentURI"));
mBaseDomain = message.optString("baseDomain");
if (message.getBoolean("sameDocument")) {
// We can get a location change event for the same document with an anchor tag
@@ -606,6 +622,7 @@ public class Tab {
setZoomConstraints(new ZoomConstraints(true));
setHasTouchListeners(false);
setBackgroundColor(DEFAULT_BACKGROUND_COLOR);
setErrorType(ErrorType.NONE);
final String homePage = message.getString("aboutHomePage");
if (!TextUtils.isEmpty(homePage)) {