Ensure extensions and the Chrome Web Store are loaded in new BrowsingInstances.

BUG=174943
TEST=Can't post message to CWS.  See bug for repro steps.


Review URL: https://chromiumcodereview.appspot.com/12301013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184208 0039d316-1c4b-4281-b951-d872f2087c98
void RenderViewHostManager::ShouldClosePage(
    bool for_cross_site_transition,
    bool proceed,
    const base::TimeTicks& proceed_time) {
  if (for_cross_site_transition) {
    if (!cross_navigation_pending_)
      return;

    if (proceed) {
      if (pending_render_view_host_ &&
          pending_render_view_host_->are_navigations_suspended()) {
        pending_render_view_host_->SetNavigationsSuspended(false);
        if (!proceed_time.is_null()) {
          pending_render_view_host_->SetNavigationStartTime(proceed_time);
        }
      }
    } else {
      CancelPending();
      cross_navigation_pending_ = false;
    }
  } else {
    bool proceed_to_fire_unload;
    delegate_->BeforeUnloadFiredFromRenderManager(proceed, proceed_time,
                                                  &proceed_to_fire_unload);

    if (proceed_to_fire_unload) {
      render_view_host_->ClosePage();
    }
  }
}

void RenderViewHostManager::ShouldClosePage(
    bool for_cross_site_transition,
    bool proceed,
    const base::TimeTicks& proceed_time) {
  if (for_cross_site_transition) {
    if (!cross_navigation_pending_)
      return;

    if (proceed) {
      if (pending_render_view_host_ &&
          pending_render_view_host_->are_navigations_suspended()) {
        pending_render_view_host_->SetNavigationsSuspended(false);
        if (!proceed_time.is_null()) {
          pending_render_view_host_->SetNavigationStartTime(proceed_time);
        }
      }
    } else {
      CancelPending();
      cross_navigation_pending_ = false;
    }
  } else {
    bool proceed_to_fire_unload;
    delegate_->BeforeUnloadFiredFromRenderManager(proceed, proceed_time,
                                                  &proceed_to_fire_unload);

    if (proceed_to_fire_unload) {
      render_view_host_->ClosePage();
    }
  }
}
