Backed out changeset 906461e491d9 (bug 915918)

This commit is contained in:
Michael Comella 2013-10-28 12:41:43 -07:00
parent ffad07d0e5
commit cc4cfe2fb1

View File

@ -167,9 +167,6 @@ abstract public class BrowserApp extends GeckoApp
private BrowserHealthReporter mBrowserHealthReporter; private BrowserHealthReporter mBrowserHealthReporter;
// The tab to be selected on editing mode exit.
private Integer mTargetTabForEditingMode = null;
// The animator used to toggle HomePager visibility has a race where if the HomePager is shown // The animator used to toggle HomePager visibility has a race where if the HomePager is shown
// (starting the animation), the HomePager is hidden, and the HomePager animation completes, // (starting the animation), the HomePager is hidden, and the HomePager animation completes,
// both the web content and the HomePager will be hidden. This flag is used to prevent the // both the web content and the HomePager will be hidden. This flag is used to prevent the
@ -490,9 +487,7 @@ abstract public class BrowserApp extends GeckoApp
mBrowserToolbar.setOnStopEditingListener(new BrowserToolbar.OnStopEditingListener() { mBrowserToolbar.setOnStopEditingListener(new BrowserToolbar.OnStopEditingListener() {
public void onStopEditing() { public void onStopEditing() {
selectTargetTabForEditingMode(); // Re-enable doorhanger notifications.
// Re-enable doorhanger notifications. They may trigger on the selected tab above.
mDoorHangerPopup.enable(); mDoorHangerPopup.enable();
} }
}); });
@ -1316,10 +1311,7 @@ abstract public class BrowserApp extends GeckoApp
if (tabs.isSelectedTabId(tabId)) { if (tabs.isSelectedTabId(tabId)) {
hideHomePager(); hideHomePager();
} else { } else {
// Set the target tab to null so it does not get selected (on editing tabs.selectTab(tabId);
// mode exit) in lieu of the tab we are about to select.
mTargetTabForEditingMode = null;
Tabs.getInstance().selectTab(tabId);
} }
hideBrowserSearch(); hideBrowserSearch();
@ -1433,9 +1425,6 @@ abstract public class BrowserApp extends GeckoApp
throw new IllegalArgumentException("Cannot handle null URLs in enterEditingMode"); throw new IllegalArgumentException("Cannot handle null URLs in enterEditingMode");
} }
final Tab selectedTab = Tabs.getInstance().getSelectedTab();
mTargetTabForEditingMode = (selectedTab != null ? selectedTab.getId() : null);
final PropertyAnimator animator = new PropertyAnimator(250); final PropertyAnimator animator = new PropertyAnimator(250);
animator.setUseHardwareLayer(false); animator.setUseHardwareLayer(false);
@ -1548,22 +1537,6 @@ abstract public class BrowserApp extends GeckoApp
} }
} }
/**
* Selects the target tab for editing mode. This is expected to be the tab selected on editing
* mode entry, unless it is subsequently overridden.
*
* A background tab may be selected while editing mode is active (e.g. popups), causing the
* new url to load in the newly selected tab. Call this method on editing mode exit to
* mitigate this.
*/
private void selectTargetTabForEditingMode() {
if (mTargetTabForEditingMode != null) {
Tabs.getInstance().selectTab(mTargetTabForEditingMode);
}
mTargetTabForEditingMode = null;
}
/** /**
* Shows or hides the home pager for the given tab. * Shows or hides the home pager for the given tab.
*/ */