mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1114600 - Get rid of unnecessary reader enabled flag in Java. r=rnewman
--HG-- extra : rebase_source : c24b01b19323840694ef472bf12b71abb552c33d
This commit is contained in:
parent
352c378a14
commit
8020afb31d
@ -53,7 +53,6 @@ public class Tab {
|
||||
private boolean mHasFeeds;
|
||||
private boolean mHasOpenSearch;
|
||||
private final SiteIdentity mSiteIdentity;
|
||||
private boolean mReaderEnabled;
|
||||
private BitmapDrawable mThumbnail;
|
||||
private final int mParentId;
|
||||
private final boolean mExternal;
|
||||
@ -262,10 +261,6 @@ public class Tab {
|
||||
return mSiteIdentity;
|
||||
}
|
||||
|
||||
public boolean getReaderEnabled() {
|
||||
return mReaderEnabled;
|
||||
}
|
||||
|
||||
public boolean isBookmark() {
|
||||
return mBookmark;
|
||||
}
|
||||
@ -474,11 +469,6 @@ public class Tab {
|
||||
mSiteIdentity.update(identityData);
|
||||
}
|
||||
|
||||
public void setReaderEnabled(boolean readerEnabled) {
|
||||
mReaderEnabled = readerEnabled;
|
||||
Tabs.getInstance().notifyListeners(this, Tabs.TabEvents.MENU_UPDATED);
|
||||
}
|
||||
|
||||
void updateBookmark() {
|
||||
if (getURL() == null) {
|
||||
return;
|
||||
@ -529,7 +519,7 @@ public class Tab {
|
||||
public void toggleReaderMode() {
|
||||
if (AboutPages.isAboutReader(mUrl)) {
|
||||
Tabs.getInstance().loadUrl(ReaderModeUtils.getUrlFromAboutReader(mUrl));
|
||||
} else if (mReaderEnabled) {
|
||||
} else {
|
||||
mEnteringReaderMode = true;
|
||||
Tabs.getInstance().loadUrl(ReaderModeUtils.getAboutReaderForUrl(mUrl, mId));
|
||||
}
|
||||
@ -614,7 +604,6 @@ public class Tab {
|
||||
setHasFeeds(false);
|
||||
setHasOpenSearch(false);
|
||||
updateIdentityData(null);
|
||||
setReaderEnabled(false);
|
||||
setZoomConstraints(new ZoomConstraints(true));
|
||||
setHasTouchListeners(false);
|
||||
setBackgroundColor(DEFAULT_BACKGROUND_COLOR);
|
||||
@ -632,7 +621,6 @@ public class Tab {
|
||||
setLoadProgress(LOAD_PROGRESS_START);
|
||||
setState((!restoring && shouldShowProgress(url)) ? STATE_LOADING : STATE_SUCCESS);
|
||||
updateIdentityData(null);
|
||||
setReaderEnabled(false);
|
||||
}
|
||||
|
||||
void handleDocumentStop(boolean success) {
|
||||
|
@ -92,7 +92,6 @@ public class Tabs implements GeckoEventListener {
|
||||
"Tab:Select",
|
||||
"Content:LocationChange",
|
||||
"Content:SecurityChange",
|
||||
"Content:ReaderEnabled",
|
||||
"Content:StateChange",
|
||||
"Content:LoadError",
|
||||
"Content:PageShow",
|
||||
@ -455,9 +454,6 @@ public class Tabs implements GeckoEventListener {
|
||||
} else if (event.equals("Content:SecurityChange")) {
|
||||
tab.updateIdentityData(message.getJSONObject("identity"));
|
||||
notifyListeners(tab, TabEvents.SECURITY_CHANGE);
|
||||
} else if (event.equals("Content:ReaderEnabled")) {
|
||||
tab.setReaderEnabled(true);
|
||||
notifyListeners(tab, TabEvents.READER_ENABLED);
|
||||
} else if (event.equals("Content:StateChange")) {
|
||||
int state = message.getInt("state");
|
||||
if ((state & GeckoAppShell.WPL_STATE_IS_NETWORK) != 0) {
|
||||
@ -577,7 +573,6 @@ public class Tabs implements GeckoEventListener {
|
||||
PAGE_SHOW,
|
||||
LINK_FEED,
|
||||
SECURITY_CHANGE,
|
||||
READER_ENABLED,
|
||||
DESKTOP_MODE_CHANGE,
|
||||
VIEWPORT_CHANGE,
|
||||
RECORDING_CHANGE,
|
||||
|
@ -4299,11 +4299,6 @@ Tab.prototype = {
|
||||
|
||||
this.savedArticle = article;
|
||||
Reader.updatePageAction(this);
|
||||
|
||||
Messaging.sendRequest({
|
||||
type: "Content:ReaderEnabled",
|
||||
tabID: this.id
|
||||
});
|
||||
}).catch(e => Cu.reportError("Error parsing document from tab: " + e));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user