Don't reload into an app process.
NavigationEntries are not safe to move from one process to another.

BUG=80621,102408
TEST=Reload a page after installing it as an app.  No process swap.

Review URL: http://codereview.chromium.org/8443005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108571 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc
index 0719038ae..6872c1ea 100644
--- a/chrome/browser/extensions/app_process_apitest.cc
+++ b/chrome/browser/extensions/app_process_apitest.cc
@@ -288,7 +288,8 @@
 
 // Ensure that reloading a URL after installing or uninstalling it as an app
 // correctly swaps the process.  (http://crbug.com/80621)
-IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadIntoAppProcess) {
+// Disabled until we get a correct fix for 80621.  See http://crbug.com/102408.
+IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) {
   CommandLine::ForCurrentProcess()->AppendSwitch(
       switches::kDisablePopupBlocking);
 
@@ -369,7 +370,6 @@
       contents->render_view_host()->process()->id()));
 }
 
-
 // Tests that if we have a non-app process (path3/container.html) that has an
 // iframe with  a URL in the app's extent (path1/iframe.html), then opening a
 // link from that iframe to a new window to a URL in the app's extent (path1/
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index c0d1e91..75f4388 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -784,15 +784,6 @@
     old_url = frame->top()->opener()->top()->document().url();
   }
 
-  // If this is a reload, check whether it has the wrong process type.  We
-  // should send it to the browser if it's an extension URL (e.g., hosted app)
-  // in a normal process, or if it's a process for an extension that has been
-  // uninstalled.
-  if (old_url == new_url) {
-    if (is_extension_url != extension_dispatcher_->is_extension_process())
-      return true;
-  }
-
   // TODO(creis): Temporary workaround for crbug.com/59285: Only return true if
   // we would enter an extension app's extent from a non-app, or if we leave an
   // extension with no web extent.  We avoid swapping processes to exit a hosted
diff --git a/content/browser/tab_contents/navigation_entry.h b/content/browser/tab_contents/navigation_entry.h
index 5f729c5..eea3f35 100644
--- a/content/browser/tab_contents/navigation_entry.h
+++ b/content/browser/tab_contents/navigation_entry.h
@@ -209,7 +209,7 @@
   //
   // Note that the SiteInstance should usually not be changed after it is set,
   // but this may happen if the NavigationEntry was cloned and needs to use a
-  // different SiteInstance, or if a hosted app is installed or uninstalled.
+  // different SiteInstance.
   void set_site_instance(SiteInstance* site_instance);
   SiteInstance* site_instance() const {
     return site_instance_;
diff --git a/content/browser/tab_contents/render_view_host_manager.cc b/content/browser/tab_contents/render_view_host_manager.cc
index 2627862..61b084b 100644
--- a/content/browser/tab_contents/render_view_host_manager.cc
+++ b/content/browser/tab_contents/render_view_host_manager.cc
@@ -387,15 +387,9 @@
   NavigationController& controller = delegate_->GetControllerForRenderManager();
   content::BrowserContext* browser_context = controller.browser_context();
 
-  // If the entry has an instance already we should use it, unless the URL
-  // is part of an app that has been installed or uninstalled since the last
-  // visit.
-  if (entry.site_instance()) {
-    if (entry.site_instance()->HasWrongProcessForURL(dest_url))
-      return curr_instance->GetRelatedSiteInstance(dest_url);
-    else
-      return entry.site_instance();
-  }
+  // If the entry has an instance already we should use it.
+  if (entry.site_instance())
+    return entry.site_instance();
 
   // (UGLY) HEURISTIC, process-per-site only:
   //