зеркало из https://github.com/mozilla/gecko-dev.git
Bug 949178 - Remove reading list button from reader mode toolbar. r=lucasr
This commit is contained in:
Родитель
130182e30e
Коммит
a2e99b9719
|
@ -356,16 +356,6 @@ abstract public class BrowserApp extends GeckoApp
|
|||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
void handleReaderListCountRequest() {
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final int count = BrowserDB.getReadingListCount(getContentResolver());
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Reader:ListCountReturn", Integer.toString(count)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void handleReaderListStatusRequest(final String url) {
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
|
@ -402,9 +392,6 @@ abstract public class BrowserApp extends GeckoApp
|
|||
public void run() {
|
||||
BrowserDB.addReadingListItem(getContentResolver(), values);
|
||||
showToast(R.string.reading_list_added, Toast.LENGTH_SHORT);
|
||||
|
||||
final int count = BrowserDB.getReadingListCount(getContentResolver());
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Reader:ListCountUpdated", Integer.toString(count)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1206,8 +1193,6 @@ abstract public class BrowserApp extends GeckoApp
|
|||
Telemetry.HistogramAdd("PLACES_BOOKMARKS_COUNT", BrowserDB.getCount(getContentResolver(), "bookmarks"));
|
||||
Telemetry.HistogramAdd("FENNEC_FAVICONS_COUNT", BrowserDB.getCount(getContentResolver(), "favicons"));
|
||||
Telemetry.HistogramAdd("FENNEC_THUMBNAILS_COUNT", BrowserDB.getCount(getContentResolver(), "thumbnails"));
|
||||
} else if (event.equals("Reader:ListCountRequest")) {
|
||||
handleReaderListCountRequest();
|
||||
} else if (event.equals("Reader:ListStatusRequest")) {
|
||||
handleReaderListStatusRequest(message.getString("url"));
|
||||
} else if (event.equals("Reader:Added")) {
|
||||
|
|
|
@ -1572,7 +1572,6 @@ public abstract class GeckoApp
|
|||
|
||||
//register for events
|
||||
registerEventListener("log");
|
||||
registerEventListener("Reader:ListCountRequest");
|
||||
registerEventListener("Reader:ListStatusRequest");
|
||||
registerEventListener("Reader:Added");
|
||||
registerEventListener("Reader:Removed");
|
||||
|
@ -2107,7 +2106,6 @@ public abstract class GeckoApp
|
|||
public void onDestroy()
|
||||
{
|
||||
unregisterEventListener("log");
|
||||
unregisterEventListener("Reader:ListCountRequest");
|
||||
unregisterEventListener("Reader:ListStatusRequest");
|
||||
unregisterEventListener("Reader:Added");
|
||||
unregisterEventListener("Reader:Removed");
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<ul id="color-scheme-buttons" class="segmented-button"></ul>
|
||||
</li>
|
||||
</ul>
|
||||
<li><a id="list-button" class="button list-button" href="#"></a></li>
|
||||
<li><a id="toggle-button" class="button toggle-button" href="#"></a></li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -7,9 +7,6 @@ let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils;
|
|||
Cu.import("resource://gre/modules/Services.jsm")
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
// Panel ID defined in HomeConfig.java.
|
||||
const READING_LIST_PANEL_ID = "20f4549a-64ad-4c32-93e4-1dcef792733b";
|
||||
|
||||
XPCOMUtils.defineLazyGetter(window, "gChromeWin", function ()
|
||||
window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
|
@ -34,8 +31,6 @@ let AboutReader = function(doc, win) {
|
|||
Services.obs.addObserver(this, "Reader:FaviconReturn", false);
|
||||
Services.obs.addObserver(this, "Reader:Add", false);
|
||||
Services.obs.addObserver(this, "Reader:Remove", false);
|
||||
Services.obs.addObserver(this, "Reader:ListCountReturn", false);
|
||||
Services.obs.addObserver(this, "Reader:ListCountUpdated", false);
|
||||
Services.obs.addObserver(this, "Reader:ListStatusReturn", false);
|
||||
|
||||
this._article = null;
|
||||
|
@ -64,7 +59,6 @@ let AboutReader = function(doc, win) {
|
|||
|
||||
this._setupAllDropdowns();
|
||||
this._setupButton("toggle-button", this._onReaderToggle.bind(this));
|
||||
this._setupButton("list-button", this._onList.bind(this));
|
||||
this._setupButton("share-button", this._onShare.bind(this));
|
||||
|
||||
let colorSchemeOptions = [
|
||||
|
@ -127,11 +121,6 @@ let AboutReader = function(doc, win) {
|
|||
this._isReadingListItem = -1;
|
||||
this._updateToggleButton();
|
||||
|
||||
// Track status of reader toolbar list button
|
||||
this._readingListCount = -1;
|
||||
this._updateListButton();
|
||||
this._requestReadingListCount();
|
||||
|
||||
let url = queryArgs.url;
|
||||
let tabId = queryArgs.tabId;
|
||||
if (tabId) {
|
||||
|
@ -215,27 +204,6 @@ AboutReader.prototype = {
|
|||
break;
|
||||
}
|
||||
|
||||
case "Reader:ListCountReturn":
|
||||
case "Reader:ListCountUpdated": {
|
||||
let count = parseInt(aData);
|
||||
if (this._readingListCount != count) {
|
||||
let isInitialStateChange = (this._readingListCount == -1);
|
||||
this._readingListCount = count;
|
||||
this._updateListButton();
|
||||
|
||||
// Display the toolbar when all its initial component states are known
|
||||
if (isInitialStateChange) {
|
||||
this._setToolbarVisibility(true);
|
||||
}
|
||||
|
||||
// Initial readinglist count is requested before any page is displayed
|
||||
if (this._article) {
|
||||
this._requestReadingListStatus();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "Reader:ListStatusReturn": {
|
||||
let args = JSON.parse(aData);
|
||||
if (args.url == this._article.url) {
|
||||
|
@ -289,8 +257,6 @@ AboutReader.prototype = {
|
|||
case "unload":
|
||||
Services.obs.removeObserver(this, "Reader:Add");
|
||||
Services.obs.removeObserver(this, "Reader:Remove");
|
||||
Services.obs.removeObserver(this, "Reader:ListCountReturn");
|
||||
Services.obs.removeObserver(this, "Reader:ListCountUpdated");
|
||||
Services.obs.removeObserver(this, "Reader:ListStatusReturn");
|
||||
break;
|
||||
}
|
||||
|
@ -306,20 +272,6 @@ AboutReader.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_updateListButton: function Reader_updateListButton() {
|
||||
let classes = this._doc.getElementById("list-button").classList;
|
||||
|
||||
if (this._readingListCount > 0) {
|
||||
classes.add("on");
|
||||
} else {
|
||||
classes.remove("on");
|
||||
}
|
||||
},
|
||||
|
||||
_requestReadingListCount: function Reader_requestReadingListCount() {
|
||||
gChromeWin.sendMessageToJava({ type: "Reader:ListCountRequest" });
|
||||
},
|
||||
|
||||
_requestReadingListStatus: function Reader_requestReadingListStatus() {
|
||||
gChromeWin.sendMessageToJava({
|
||||
type: "Reader:ListStatusRequest",
|
||||
|
@ -361,13 +313,6 @@ AboutReader.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_onList: function Reader_onList() {
|
||||
if (!this._article || this._readingListCount < 1)
|
||||
return;
|
||||
|
||||
gChromeWin.BrowserApp.loadURI("about:home?panel=" + READING_LIST_PANEL_ID);
|
||||
},
|
||||
|
||||
_onShare: function Reader_onShare() {
|
||||
if (!this._article)
|
||||
return;
|
||||
|
@ -494,7 +439,7 @@ AboutReader.prototype = {
|
|||
return;
|
||||
|
||||
// Don't allow visible toolbar until banner state is known
|
||||
if (this._readingListCount == -1 || this._isReadingListItem == -1)
|
||||
if (this._isReadingListItem == -1)
|
||||
return;
|
||||
|
||||
if (this._getToolbarVisibility() === visible)
|
||||
|
|
|
@ -346,7 +346,7 @@ body {
|
|||
|
||||
.toolbar > * {
|
||||
float: right;
|
||||
width: 25%;
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.button {
|
||||
|
@ -496,14 +496,6 @@ body {
|
|||
background-image: url('chrome://browser/skin/images/reader-toggle-off-icon-mdpi.png');
|
||||
}
|
||||
|
||||
.list-button.on {
|
||||
background-image: url('chrome://browser/skin/images/reader-list-on-icon-mdpi.png');
|
||||
}
|
||||
|
||||
.list-button {
|
||||
background-image: url('chrome://browser/skin/images/reader-list-off-icon-mdpi.png');
|
||||
}
|
||||
|
||||
.share-button {
|
||||
background-image: url('chrome://browser/skin/images/reader-share-icon-mdpi.png');
|
||||
}
|
||||
|
@ -533,14 +525,6 @@ body {
|
|||
background-image: url('chrome://browser/skin/images/reader-toggle-off-icon-hdpi.png');
|
||||
}
|
||||
|
||||
.list-button.on {
|
||||
background-image: url('chrome://browser/skin/images/reader-list-on-icon-hdpi.png');
|
||||
}
|
||||
|
||||
.list-button {
|
||||
background-image: url('chrome://browser/skin/images/reader-list-off-icon-hdpi.png');
|
||||
}
|
||||
|
||||
.share-button {
|
||||
background-image: url('chrome://browser/skin/images/reader-share-icon-hdpi.png');
|
||||
}
|
||||
|
@ -571,14 +555,6 @@ body {
|
|||
background-image: url('chrome://browser/skin/images/reader-toggle-off-icon-xhdpi.png');
|
||||
}
|
||||
|
||||
.list-button.on {
|
||||
background-image: url('chrome://browser/skin/images/reader-list-on-icon-xhdpi.png');
|
||||
}
|
||||
|
||||
.list-button {
|
||||
background-image: url('chrome://browser/skin/images/reader-list-off-icon-xhdpi.png');
|
||||
}
|
||||
|
||||
.share-button {
|
||||
background-image: url('chrome://browser/skin/images/reader-share-icon-xhdpi.png');
|
||||
}
|
||||
|
|
Двоичные данные
mobile/android/themes/core/images/reader-list-off-icon-hdpi.png
Двоичные данные
mobile/android/themes/core/images/reader-list-off-icon-hdpi.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 380 B |
Двоичные данные
mobile/android/themes/core/images/reader-list-off-icon-mdpi.png
Двоичные данные
mobile/android/themes/core/images/reader-list-off-icon-mdpi.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 435 B |
Двоичные данные
mobile/android/themes/core/images/reader-list-off-icon-xhdpi.png
Двоичные данные
mobile/android/themes/core/images/reader-list-off-icon-xhdpi.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 627 B |
Двоичные данные
mobile/android/themes/core/images/reader-list-on-icon-hdpi.png
Двоичные данные
mobile/android/themes/core/images/reader-list-on-icon-hdpi.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 195 B |
Двоичные данные
mobile/android/themes/core/images/reader-list-on-icon-mdpi.png
Двоичные данные
mobile/android/themes/core/images/reader-list-on-icon-mdpi.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 286 B |
Двоичные данные
mobile/android/themes/core/images/reader-list-on-icon-xhdpi.png
Двоичные данные
mobile/android/themes/core/images/reader-list-on-icon-xhdpi.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 389 B |
|
@ -79,12 +79,6 @@ chrome.jar:
|
|||
skin/images/reader-dropdown-arrow-mdpi.png (images/reader-dropdown-arrow-mdpi.png)
|
||||
skin/images/reader-dropdown-arrow-hdpi.png (images/reader-dropdown-arrow-hdpi.png)
|
||||
skin/images/reader-dropdown-arrow-xhdpi.png (images/reader-dropdown-arrow-xhdpi.png)
|
||||
skin/images/reader-list-on-icon-mdpi.png (images/reader-list-on-icon-mdpi.png)
|
||||
skin/images/reader-list-on-icon-hdpi.png (images/reader-list-on-icon-hdpi.png)
|
||||
skin/images/reader-list-on-icon-xhdpi.png (images/reader-list-on-icon-xhdpi.png)
|
||||
skin/images/reader-list-off-icon-mdpi.png (images/reader-list-off-icon-mdpi.png)
|
||||
skin/images/reader-list-off-icon-hdpi.png (images/reader-list-off-icon-hdpi.png)
|
||||
skin/images/reader-list-off-icon-xhdpi.png (images/reader-list-off-icon-xhdpi.png)
|
||||
skin/images/reader-toggle-on-icon-mdpi.png (images/reader-toggle-on-icon-mdpi.png)
|
||||
skin/images/reader-toggle-on-icon-hdpi.png (images/reader-toggle-on-icon-hdpi.png)
|
||||
skin/images/reader-toggle-on-icon-xhdpi.png (images/reader-toggle-on-icon-xhdpi.png)
|
||||
|
|
Загрузка…
Ссылка в новой задаче