Bug 941868 - Part 5a: uncontested cleanup and logging. r=mcomella

This commit is contained in:
Richard Newman 2013-11-27 12:21:08 -08:00
Родитель 978efb04dc
Коммит cd19c8d3bb
3 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -627,6 +627,12 @@ public class Tab {
final String uri = message.getString("uri");
final String oldUrl = getURL();
mEnteringReaderMode = ReaderModeUtils.isEnteringReaderMode(oldUrl, uri);
if (TextUtils.equals(oldUrl, uri)) {
Log.d(LOGTAG, "Ignoring location change event: URIs are the same.");
return;
}
updateURL(uri);
updateUserSearch(message.getString("userSearch"));
@ -639,7 +645,13 @@ public class Tab {
}
setContentType(message.getString("contentType"));
// We can unconditionally clear the favicon here: we already
// short-circuited for both cases in which this was a (pseudo-)
// spurious location change, so we're definitely loading a new page.
// The same applies to all of the other fields we're wiping out.
clearFavicon();
setHasFeeds(false);
updateTitle(null);
updateIdentityData(null);

Просмотреть файл

@ -382,6 +382,7 @@ public class Tabs implements GeckoEventListener {
@Override
public void handleMessage(String event, JSONObject message) {
Log.d(LOGTAG, "handleMessage: " + event);
try {
if (event.equals("Session:RestoreEnd")) {
notifyListeners(null, TabEvents.RESTORED);

Просмотреть файл

@ -536,6 +536,7 @@ public class BrowserToolbar extends GeckoRelativeLayout
@Override
public void onTabChanged(Tab tab, Tabs.TabEvents msg, Object data) {
Log.d(LOGTAG, "onTabChanged: " + msg);
final Tabs tabs = Tabs.getInstance();
// These conditions are split into three phases:
@ -764,8 +765,9 @@ public class BrowserToolbar extends GeckoRelativeLayout
Log.i(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - Throbber start");
} else {
Tab selectedTab = Tabs.getInstance().getSelectedTab();
if (selectedTab != null)
if (selectedTab != null) {
setFavicon(selectedTab.getFavicon());
}
if (mSpinnerVisible) {
setPageActionVisibility(false);
@ -1588,6 +1590,7 @@ public class BrowserToolbar extends GeckoRelativeLayout
@Override
public void handleMessage(String event, JSONObject message) {
Log.d(LOGTAG, "handleMessage: " + event);
if (event.equals("Reader:Click")) {
Tab tab = Tabs.getInstance().getSelectedTab();
if (tab != null) {