chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab.

BUG=chromium-os:12088
TEST=verify bug per bug report.
Review URL: http://codereview.chromium.org/6882058

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83031 0039d316-1c4b-4281-b951-d872f2087c98
void Browser::ProcessPendingTabs() {
  if (!is_attempting_to_close_browser_) {
    return;
  }

  if (HasCompletedUnloadProcessing()) {
    OnWindowClosing();
    return;
  }

  if (!tabs_needing_before_unload_fired_.empty()) {
    TabContents* tab = *(tabs_needing_before_unload_fired_.begin());
    if (tab->render_view_host()) {
      tab->render_view_host()->FirePageBeforeUnload(false);
    } else {
      ClearUnloadState(tab, true);
    }
  } else if (!tabs_needing_unload_fired_.empty()) {
    TabContents* tab = *(tabs_needing_unload_fired_.begin());
    if (tab->render_view_host()) {
      tab->render_view_host()->ClosePage(false, -1, -1);
    } else {
      ClearUnloadState(tab, true);
    }
  } else {
    NOTREACHED();
  }
}

void Browser::ProcessPendingTabs() {
  if (!is_attempting_to_close_browser_) {
    return;
  }

  if (HasCompletedUnloadProcessing()) {
    OnWindowClosing();
    return;
  }

  if (!tabs_needing_before_unload_fired_.empty()) {
    TabContents* tab = *(tabs_needing_before_unload_fired_.begin());
    if (tab->render_view_host()) {
      tab->render_view_host()->FirePageBeforeUnload(false);
    } else {
      ClearUnloadState(tab, true);
    }
  } else if (!tabs_needing_unload_fired_.empty()) {
    TabContents* tab = *(tabs_needing_unload_fired_.begin());
    if (tab->render_view_host()) {
      tab->render_view_host()->ClosePage(false, -1, -1);
    } else {
      ClearUnloadState(tab, true);
    }
  } else {
    NOTREACHED();
  }
}
