[Extensions] Remove callback from ExtensionService::UninstallExtension

ExtensionService::UninstallExtension takes a callback to call when the
data is removed for the extension's origin. Of the 60+ callers to this
method, the vast majority passed in base::Bind(&base::DoNothing), with
a handful more passing in an empty base::Closure. Only a single caller
(WebstoreReinstaller) passed in a "real" callback, and it appears to
be unnecessary. Additionally, the callback is already misleading - it
corresponds to removing storage partition data, but not chrome.storage
data.

This callback is also making a refactor on the cookies interface more
complicated, and may not be possible to maintain.

Remove the callback from the method interface.

Bug: 721395, 787563
[email protected] (c/b/apps)
[email protected] (c/b/background, c/b/policy)
[email protected] (c/b/chromeos)
[email protected] (c/b/search)
[email protected] (c/b/themes)
[email protected] (c/b/ui)

Change-Id: I1cbffd781fb90a40ff597e20ae80812b8646c5ef
Reviewed-on: https://chromium-review.googlesource.com/778040
Commit-Queue: Devlin <[email protected]>
Reviewed-by: Randy Smith <[email protected]>
Reviewed-by: Karan Bhatia <[email protected]>
Cr-Commit-Position: refs/heads/master@{#518402}
diff --git a/chrome/browser/apps/drive/drive_app_provider.cc b/chrome/browser/apps/drive/drive_app_provider.cc
index ef92109..1dcff6c 100644
--- a/chrome/browser/apps/drive/drive_app_provider.cc
+++ b/chrome/browser/apps/drive/drive_app_provider.cc
@@ -119,7 +119,6 @@
         ->extension_service()
         ->UninstallExtension(existing_chrome_app_id,
                              extensions::UNINSTALL_REASON_SYNC,
-                             base::Bind(&base::DoNothing),
                              NULL);
   }
 }
@@ -234,7 +233,6 @@
       ->extension_service()
       ->UninstallExtension(chrome_app_id,
                            extensions::UNINSTALL_REASON_SYNC,
-                           base::Bind(&base::DoNothing),
                            NULL);
 }
 
diff --git a/chrome/browser/background/background_application_list_model_unittest.cc b/chrome/browser/background/background_application_list_model_unittest.cc
index 927aa3ea..6463f02 100644
--- a/chrome/browser/background/background_application_list_model_unittest.cc
+++ b/chrome/browser/background/background_application_list_model_unittest.cc
@@ -195,32 +195,27 @@
   // Remove in FIFO order.
   ASSERT_FALSE(IsBackgroundApp(*ext1.get()));
   service()->UninstallExtension(ext1->id(),
-                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing), NULL);
+                                extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
   ASSERT_EQ(4U, registry()->enabled_extensions().size());
   ASSERT_EQ(2U, model()->size());
   ASSERT_TRUE(IsBackgroundApp(*bgapp1.get()));
   service()->UninstallExtension(bgapp1->id(),
-                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing), NULL);
+                                extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
   ASSERT_EQ(3U, registry()->enabled_extensions().size());
   ASSERT_EQ(1U, model()->size());
   ASSERT_FALSE(IsBackgroundApp(*ext2.get()));
   service()->UninstallExtension(ext2->id(),
-                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing), NULL);
+                                extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
   ASSERT_EQ(2U, registry()->enabled_extensions().size());
   ASSERT_EQ(1U, model()->size());
   ASSERT_TRUE(IsBackgroundApp(*bgapp2.get()));
   service()->UninstallExtension(bgapp2->id(),
-                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing), NULL);
+                                extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
   ASSERT_EQ(1U, registry()->enabled_extensions().size());
   ASSERT_EQ(0U, model()->size());
   ASSERT_FALSE(IsBackgroundApp(*ext3.get()));
   service()->UninstallExtension(ext3->id(),
-                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing), NULL);
+                                extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
   ASSERT_EQ(0U, registry()->enabled_extensions().size());
   ASSERT_EQ(0U, model()->size());
 }
@@ -387,8 +382,7 @@
     --*count;
     ASSERT_EQ(*count, extensions->size());
     service->UninstallExtension(extension->id(),
-                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing), NULL);
+                                extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
     ASSERT_EQ(*count, registry->enabled_extensions().size());
     ASSERT_EQ(*expected, model->size());
   }
diff --git a/chrome/browser/chromeos/extensions/gfx_utils_unittest.cc b/chrome/browser/chromeos/extensions/gfx_utils_unittest.cc
index b29934e..a3fd3d45 100644
--- a/chrome/browser/chromeos/extensions/gfx_utils_unittest.cc
+++ b/chrome/browser/chromeos/extensions/gfx_utils_unittest.cc
@@ -98,9 +98,8 @@
   }
 
   void RemoveExtension(const Extension* extension) {
-    service()->UninstallExtension(extension->id(),
-                                  extensions::UNINSTALL_REASON_FOR_TESTING,
-                                  base::Bind(&base::DoNothing), NULL);
+    service()->UninstallExtension(
+        extension->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
   }
 
  private:
diff --git a/chrome/browser/chromeos/lock_screen_apps/app_manager_impl.cc b/chrome/browser/chromeos/lock_screen_apps/app_manager_impl.cc
index 21cee50..f497556 100644
--- a/chrome/browser/chromeos/lock_screen_apps/app_manager_impl.cc
+++ b/chrome/browser/chromeos/lock_screen_apps/app_manager_impl.cc
@@ -449,9 +449,8 @@
   base::string16 error;
   extensions::ExtensionSystem::Get(lock_screen_profile_)
       ->extension_service()
-      ->UninstallExtension(app_id,
-                           extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT,
-                           base::Bind(&base::DoNothing), &error);
+      ->UninstallExtension(
+          app_id, extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT, &error);
 }
 
 }  // namespace lock_screen_apps
diff --git a/chrome/browser/chromeos/note_taking_helper_unittest.cc b/chrome/browser/chromeos/note_taking_helper_unittest.cc
index e36f84ca..8dd8f38 100644
--- a/chrome/browser/chromeos/note_taking_helper_unittest.cc
+++ b/chrome/browser/chromeos/note_taking_helper_unittest.cc
@@ -369,8 +369,7 @@
         ->extension_service()
         ->UninstallExtension(
             extension->id(),
-            extensions::UninstallReason::UNINSTALL_REASON_FOR_TESTING,
-            base::Closure(), &error);
+            extensions::UninstallReason::UNINSTALL_REASON_FOR_TESTING, &error);
     FlushNoteTakingClientMojo();
   }
 
diff --git a/chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc
index ba81a54..0a17764 100644
--- a/chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc
+++ b/chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc
@@ -181,7 +181,6 @@
   extension_service1->UninstallExtension(
       kExtensionID,
       extensions::UNINSTALL_REASON_FOR_TESTING,
-      base::Bind(&base::DoNothing),
       NULL);
 
   EXPECT_EQ(0,
@@ -260,7 +259,6 @@
   extension_service->UninstallExtension(
       kExtensionID,
       extensions::UNINSTALL_REASON_FOR_TESTING,
-      base::Bind(&base::DoNothing),
       NULL);
 
   EXPECT_TRUE(activity_log->IsDatabaseEnabled());
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
index 7077fa4..88a0d6da 100644
--- a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
+++ b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
@@ -935,7 +935,6 @@
   ASSERT_TRUE(extension_service->UninstallExtension(
       extension->id(),
       UNINSTALL_REASON_FOR_TESTING,
-      base::Bind(&base::DoNothing),
       &error));
   ASSERT_EQ(base::ASCIIToUTF16(""), error);
 
diff --git a/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc b/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
index 6e80a0f..ecebcd2 100644
--- a/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
+++ b/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
@@ -314,12 +314,10 @@
     content::BrowserContext* context,
     const std::string& transient_extension_id,
     extensions::UninstallReason reason,
-    const base::Closure& deletion_done_callback,
     base::string16* error) const {
   return extensions::ExtensionSystem::Get(context)
       ->extension_service()
-      ->UninstallExtension(transient_extension_id, reason,
-                           deletion_done_callback, error);
+      ->UninstallExtension(transient_extension_id, reason, error);
 }
 
 void ChromeManagementAPIDelegate::SetLaunchType(
diff --git a/chrome/browser/extensions/api/management/chrome_management_api_delegate.h b/chrome/browser/extensions/api/management/chrome_management_api_delegate.h
index db1ed81..fa8e88c5 100644
--- a/chrome/browser/extensions/api/management/chrome_management_api_delegate.h
+++ b/chrome/browser/extensions/api/management/chrome_management_api_delegate.h
@@ -57,7 +57,6 @@
   bool UninstallExtension(content::BrowserContext* context,
                           const std::string& transient_extension_id,
                           extensions::UninstallReason reason,
-                          const base::Closure& deletion_done_callback,
                           base::string16* error) const override;
   void SetLaunchType(content::BrowserContext* context,
                      const std::string& extension_id,
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc
index 009bf95..a98bd49 100644
--- a/chrome/browser/extensions/extension_browsertest.cc
+++ b/chrome/browser/extensions/extension_browsertest.cc
@@ -566,7 +566,6 @@
       profile())->extension_service();
   service->UninstallExtension(extension_id,
                               extensions::UNINSTALL_REASON_FOR_TESTING,
-                              base::Bind(&base::DoNothing),
                               NULL);
 }
 
diff --git a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
index 0aeb2cef..8dace99 100644
--- a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
+++ b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
@@ -343,7 +343,6 @@
     extension_service_->UninstallExtension(
         extension->id(),
         extensions::UNINSTALL_REASON_FOR_TESTING,
-        base::Bind(&base::DoNothing),
         NULL);
   }
 
diff --git a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc
index 378f8a66..3696970d 100644
--- a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc
+++ b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc
@@ -469,8 +469,7 @@
 
   // Uninstall the current ntp-controlling extension, allowing the other to
   // take control.
-  service_->UninstallExtension(kId2, UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing), nullptr);
+  service_->UninstallExtension(kId2, UNINSTALL_REASON_FOR_TESTING, nullptr);
 
   // Even though we already showed for the given profile, we should show
   // again, because it's a different extension.
@@ -806,15 +805,12 @@
     // Clean up after ourselves.
     service_->UninstallExtension(kId1,
                                  extensions::UNINSTALL_REASON_FOR_TESTING,
-                                 base::Bind(&base::DoNothing),
                                  NULL);
     service_->UninstallExtension(kId2,
                                  extensions::UNINSTALL_REASON_FOR_TESTING,
-                                 base::Bind(&base::DoNothing),
                                  NULL);
     service_->UninstallExtension(kId3,
                                  extensions::UNINSTALL_REASON_FOR_TESTING,
-                                 base::Bind(&base::DoNothing),
                                  NULL);
   }
 }
@@ -842,8 +838,7 @@
   EXPECT_FALSE(bubble.is_closed());
 
   // Uninstall the extension.
-  service_->UninstallExtension(kId1, UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing), nullptr);
+  service_->UninstallExtension(kId1, UNINSTALL_REASON_FOR_TESTING, nullptr);
   ASSERT_EQ(0U, controller->GetExtensionList().size());
 
   // The bubble should be closed after the extension is uninstalled.
@@ -896,8 +891,7 @@
   EXPECT_FALSE(bubble.is_closed());
 
   // Uninstall the extension.
-  service_->UninstallExtension(kId1, UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing), nullptr);
+  service_->UninstallExtension(kId1, UNINSTALL_REASON_FOR_TESTING, nullptr);
   ASSERT_EQ(0U, controller->GetExtensionList().size());
 
   // The bubble should be closed after the extension is uninstalled.
@@ -933,18 +927,15 @@
   EXPECT_FALSE(bubble.is_closed());
 
   // Uninstall one of the three extensions.
-  service_->UninstallExtension(kId1, UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing), nullptr);
+  service_->UninstallExtension(kId1, UNINSTALL_REASON_FOR_TESTING, nullptr);
   ASSERT_EQ(2U, controller->GetExtensionList().size());
 
   // The bubble should still be shown for the remaining installed extensions.
   EXPECT_FALSE(bubble.is_closed());
 
   // Uninstall the remaining two extensions.
-  service_->UninstallExtension(kId2, UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing), nullptr);
-  service_->UninstallExtension(kId3, UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing), nullptr);
+  service_->UninstallExtension(kId2, UNINSTALL_REASON_FOR_TESTING, nullptr);
+  service_->UninstallExtension(kId3, UNINSTALL_REASON_FOR_TESTING, nullptr);
   ASSERT_EQ(0U, controller->GetExtensionList().size());
 
   // Since all the bubble's associated extensions are uninstalled, the bubble
@@ -1056,15 +1047,12 @@
   // Clean up after ourselves.
   service_->UninstallExtension(kId1,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
   service_->UninstallExtension(kId2,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
   service_->UninstallExtension(kId3,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
 }
 
@@ -1203,15 +1191,12 @@
   // Clean up after ourselves.
   service_->UninstallExtension(kId1,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
   service_->UninstallExtension(kId2,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
   service_->UninstallExtension(kId3,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
 }
 
@@ -1261,7 +1246,7 @@
   EXPECT_TRUE(model->is_highlighting());
   set_browser(nullptr);
   service_->UninstallExtension(kId1, extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing), nullptr);
+                               nullptr);
   EXPECT_FALSE(model->is_highlighting());
   controller.reset();
 }
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 75f45c3..4c1f9746 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -179,9 +179,8 @@
                  << "with id: " << id;
     return;
   }
-  UninstallExtension(id,
-                     extensions::UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION,
-                     base::Bind(&base::DoNothing), nullptr);
+  UninstallExtension(
+      id, extensions::UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION, nullptr);
 }
 
 void ExtensionService::ClearProvidersForTesting() {
@@ -298,8 +297,7 @@
   // The following call to UninstallExtension will not allow an uninstall of a
   // policy-controlled extension.
   base::string16 error;
-  if (!extensions_service->UninstallExtension(
-          extension_id, reason, base::Bind(&base::DoNothing), &error)) {
+  if (!extensions_service->UninstallExtension(extension_id, reason, &error)) {
     LOG(WARNING) << "Cannot uninstall extension with id " << extension_id
                  << ": " << error;
     return false;
@@ -787,7 +785,6 @@
     // to become invalid. Instead, use |extenson->id()|.
     const std::string& transient_extension_id,
     extensions::UninstallReason reason,
-    const base::Closure& deletion_done_callback,
     base::string16* error) {
   CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 
@@ -847,8 +844,8 @@
       NOTREACHED();
   }
 
-  extensions::DataDeleter::StartDeleting(
-      profile_, extension.get(), deletion_done_callback);
+  extensions::DataDeleter::StartDeleting(profile_, extension.get(),
+                                         base::Bind(&base::DoNothing));
 
   extension_registrar_.UntrackTerminatedExtension(extension->id());
 
@@ -2420,7 +2417,7 @@
   for (const std::string& extension_id : kMigratedExtensionIds) {
     if (installed_extensions->Contains(extension_id)) {
       UninstallExtension(extension_id, extensions::UNINSTALL_REASON_MIGRATED,
-                         base::Bind(&base::DoNothing), nullptr);
+                         nullptr);
     }
   }
 }
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index afe623d..90729097 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -267,12 +267,14 @@
   // Uninstalls the specified extension. Callers should only call this method
   // with extensions that exist. |reason| lets the caller specify why the
   // extension is uninstalled.
-  //
-  // If the return value is true, |deletion_done_callback| is invoked when data
-  // deletion is done or at least is scheduled.
+  // Note: this method synchronously removes the extension from the
+  // set of installed extensions stored in the ExtensionRegistry, but will
+  // asynchronously remove site-related data and the files stored on disk.
+  // Returns true if an uninstall was successfully triggered; this can fail if
+  // the extension cannot be uninstalled (such as a policy force-installed
+  // extension).
   virtual bool UninstallExtension(const std::string& extension_id,
                                   extensions::UninstallReason reason,
-                                  const base::Closure& deletion_done_callback,
                                   base::string16* error);
 
   // Enables the extension.  If the extension is already enabled, does
diff --git a/chrome/browser/extensions/extension_service_test_with_install.cc b/chrome/browser/extensions/extension_service_test_with_install.cc
index f29321c..b1820d1 100644
--- a/chrome/browser/extensions/extension_service_test_with_install.cc
+++ b/chrome/browser/extensions/extension_service_test_with_install.cc
@@ -345,8 +345,7 @@
         service(), id, extensions::UNINSTALL_REASON_FOR_TESTING));
   } else {
     EXPECT_TRUE(service()->UninstallExtension(
-        id, extensions::UNINSTALL_REASON_FOR_TESTING,
-        base::Bind(&base::DoNothing), nullptr));
+        id, extensions::UNINSTALL_REASON_FOR_TESTING, nullptr));
   }
   --expected_extensions_count_;
 
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 623ec722..7f5b61f 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -3968,7 +3968,6 @@
   EXPECT_TRUE(
       service()->UninstallExtension(extension->id(),
                                     extensions::UNINSTALL_REASON_FOR_TESTING,
-                                    base::Bind(&base::DoNothing),
                                     NULL));
   EXPECT_EQ(0u, registry()->enabled_extensions().size());
 
@@ -4034,7 +4033,6 @@
   EXPECT_FALSE(
       service()->UninstallExtension(good_crx,
                                     extensions::UNINSTALL_REASON_FOR_TESTING,
-                                    base::Bind(&base::DoNothing),
                                     NULL));
 
   EXPECT_EQ(1u, registry()->enabled_extensions().size());
@@ -4919,14 +4917,14 @@
   idb_context->ResetCachesForTesting();
 
   // Uninstall the extension.
-  base::RunLoop run_loop;
   ASSERT_TRUE(
       service()->UninstallExtension(good_crx,
                                     extensions::UNINSTALL_REASON_FOR_TESTING,
-                                    run_loop.QuitClosure(),
                                     NULL));
-  // The data deletion happens on the IO thread.
-  run_loop.Run();
+  // The data deletion happens on the IO thread; since we use a
+  // TestBrowserThreadBundle (without REAL_IO_THREAD), the IO and UI threads are
+  // the same, and RunAllTasksUntilIdle() should run IO thread tasks.
+  content::RunAllTasksUntilIdle();
 
   // Check that the cookie is gone.
   cookie_store->GetAllCookiesForURLAsync(
@@ -5124,7 +5122,6 @@
   EXPECT_FALSE(unloaded_id_.length());
   service()->UninstallExtension(id,
                                 extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing),
                                 NULL);
   content::RunAllTasksUntilIdle();
   EXPECT_EQ(id, unloaded_id_);
@@ -5231,7 +5228,6 @@
       GetManagementPolicy()->MustRemainEnabled(loaded_[0].get(), NULL);
   service()->UninstallExtension(id,
                                 extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing),
                                 NULL);
   content::RunAllTasksUntilIdle();
 
@@ -5290,7 +5286,6 @@
     loaded_.clear();
     service()->UninstallExtension(id,
                                   extensions::UNINSTALL_REASON_FOR_TESTING,
-                                  base::Bind(&base::DoNothing),
                                   NULL);
     content::RunAllTasksUntilIdle();
     ASSERT_EQ(0u, loaded_.size());
@@ -7143,8 +7138,7 @@
   EXPECT_NE(nullptr, registry()->GetInstalledExtension(id));
   base::string16 error;
   EXPECT_TRUE(service()->UninstallExtension(
-      id, extensions::UNINSTALL_REASON_USER_INITIATED,
-      base::Bind(&base::DoNothing), nullptr));
+      id, extensions::UNINSTALL_REASON_USER_INITIATED, nullptr));
   EXPECT_EQ(nullptr, registry()->GetInstalledExtension(id));
 }
 
diff --git a/chrome/browser/extensions/extension_uninstall_dialog.cc b/chrome/browser/extensions/extension_uninstall_dialog.cc
index 11405b7..32278e03 100644
--- a/chrome/browser/extensions/extension_uninstall_dialog.cc
+++ b/chrome/browser/extensions/extension_uninstall_dialog.cc
@@ -205,8 +205,7 @@
     observer_.RemoveAll();
     return ExtensionSystem::Get(profile_)
         ->extension_service()
-        ->UninstallExtension(extension_->id(), uninstall_reason_,
-                             base::Bind(&base::DoNothing), error);
+        ->UninstallExtension(extension_->id(), uninstall_reason_, error);
   }
   *error = base::ASCIIToUTF16(kExtensionRemovedError);
   return false;
diff --git a/chrome/browser/extensions/external_install_error.cc b/chrome/browser/extensions/external_install_error.cc
index 8d865577..d1d9c144 100644
--- a/chrome/browser/extensions/external_install_error.cc
+++ b/chrome/browser/extensions/external_install_error.cc
@@ -348,7 +348,6 @@
             ->extension_service()
             ->UninstallExtension(extension_id_,
                                  extensions::UNINSTALL_REASON_INSTALL_CANCELED,
-                                 base::Bind(&base::DoNothing),
                                  nullptr);  // Ignore error.
         UMA_HISTOGRAM_BOOLEAN("Extensions.ExternalWarningUninstallationResult",
                               uninstallation_result);
diff --git a/chrome/browser/extensions/service_worker_apitest.cc b/chrome/browser/extensions/service_worker_apitest.cc
index 314c2ea..b0b7d32 100644
--- a/chrome/browser/extensions/service_worker_apitest.cc
+++ b/chrome/browser/extensions/service_worker_apitest.cc
@@ -627,8 +627,7 @@
   // Uninstall the extension. Opening pages should fail again.
   base::string16 error;
   extension_service()->UninstallExtension(
-      extension_id, UninstallReason::UNINSTALL_REASON_FOR_TESTING,
-      base::Bind(&base::DoNothing), &error);
+      extension_id, UninstallReason::UNINSTALL_REASON_FOR_TESTING, &error);
   base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(content::PAGE_TYPE_ERROR,
diff --git a/chrome/browser/extensions/shared_module_service.cc b/chrome/browser/extensions/shared_module_service.cc
index 64284ba..81061e0 100644
--- a/chrome/browser/extensions/shared_module_service.cc
+++ b/chrome/browser/extensions/shared_module_service.cc
@@ -186,7 +186,6 @@
     service->UninstallExtension(
         *shared_modules_iter,
         extensions::UNINSTALL_REASON_ORPHANED_SHARED_MODULE,
-        base::Bind(&base::DoNothing),
         NULL);  // Ignore error.
   }
 }
diff --git a/chrome/browser/extensions/shared_module_service_unittest.cc b/chrome/browser/extensions/shared_module_service_unittest.cc
index a74f318..a9c09c1 100644
--- a/chrome/browser/extensions/shared_module_service_unittest.cc
+++ b/chrome/browser/extensions/shared_module_service_unittest.cc
@@ -160,7 +160,6 @@
   base::string16 error;
   service()->UninstallExtension(importing_extension->id(),
                                 extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing),
                                 &error);
   EXPECT_TRUE(error.empty());
 
@@ -298,7 +297,7 @@
   base::string16 error;
   service()->UninstallExtension(importing_extension->id(),
                                 extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing), &error);
+                                &error);
   EXPECT_TRUE(error.empty());
 
   // Since the modules were only referenced by that single extension, they
diff --git a/chrome/browser/extensions/webstore_inline_installer_browsertest.cc b/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
index 81cdd55..8ca86623 100644
--- a/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
+++ b/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
@@ -552,8 +552,7 @@
   // Rinse and repeat: uninstall the extension, open a new tab, and install it
   // again. Regression test for crbug.com/613949.
   extension_service()->UninstallExtension(
-      kTestExtensionId, UNINSTALL_REASON_FOR_TESTING,
-      base::Bind(&base::DoNothing), nullptr);
+      kTestExtensionId, UNINSTALL_REASON_FOR_TESTING, nullptr);
   base::RunLoop().RunUntilIdle();
   EXPECT_FALSE(registry->enabled_extensions().GetByID(kTestExtensionId));
   int old_tab_index = browser()->tab_strip_model()->active_index();
diff --git a/chrome/browser/extensions/webstore_reinstaller.cc b/chrome/browser/extensions/webstore_reinstaller.cc
index 48d5a98f..720b69e6 100644
--- a/chrome/browser/extensions/webstore_reinstaller.cc
+++ b/chrome/browser/extensions/webstore_reinstaller.cc
@@ -99,18 +99,14 @@
   if (!ExtensionSystem::Get(profile())->extension_service()->UninstallExtension(
           id(),
           UNINSTALL_REASON_REINSTALL,
-          base::Bind(&WebstoreReinstaller::OnDeletionDone, this),
           NULL)) {
     // Run the callback now, because AbortInstall() doesn't do it.
     RunCallback(
         false, kCouldNotUninstallExtension, webstore_install::OTHER_ERROR);
     AbortInstall();
+    return;
   }
-}
-
-void WebstoreReinstaller::OnDeletionDone() {
-  WebstoreStandaloneInstaller::OnInstallPromptDone(
-      ExtensionInstallPrompt::Result::ACCEPTED);
+  WebstoreStandaloneInstaller::OnInstallPromptDone(result);
 }
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/webstore_reinstaller.h b/chrome/browser/extensions/webstore_reinstaller.h
index 4123440..19996fcf 100644
--- a/chrome/browser/extensions/webstore_reinstaller.h
+++ b/chrome/browser/extensions/webstore_reinstaller.h
@@ -44,9 +44,6 @@
 
   // content::WebContentsObserver:
   void WebContentsDestroyed() override;
-
-  // Called once all data from the old extension installation is removed.
-  void OnDeletionDone();
 };
 
 }  // namespace extensions
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 97be86c..837398bf 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -731,8 +731,7 @@
       extensions::TestExtensionRegistryObserver observer(
           extensions::ExtensionRegistry::Get(browser()->profile()));
       extension_service()->UninstallExtension(
-          id, extensions::UNINSTALL_REASON_FOR_TESTING,
-          base::Bind(&base::DoNothing), NULL);
+          id, extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
       observer.WaitForExtensionUninstalled();
     } else {
       content::WindowedNotificationObserver observer(
@@ -741,7 +740,6 @@
       extension_service()->UninstallExtension(
           id,
           extensions::UNINSTALL_REASON_FOR_TESTING,
-          base::Bind(&base::DoNothing),
           NULL);
       observer.Wait();
     }
diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc
index 0e76ff8..a19cdfe 100644
--- a/chrome/browser/search/hotword_service.cc
+++ b/chrome/browser/search/hotword_service.cc
@@ -580,7 +580,6 @@
   if (!extension_service->UninstallExtension(
           extension_id,
           extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT,
-          base::Bind(&base::DoNothing),
           &error)) {
     LOG(WARNING) << "Cannot uninstall extension with id "
                  << extension_id
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 601aef0b..f1ef4e1 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -386,9 +386,8 @@
   // policy provider.
 
   for (size_t i = 0; i < remove_list.size(); ++i) {
-    service->UninstallExtension(remove_list[i],
-                                extensions::UNINSTALL_REASON_ORPHANED_THEME,
-                                base::Bind(&base::DoNothing), nullptr);
+    service->UninstallExtension(
+        remove_list[i], extensions::UNINSTALL_REASON_ORPHANED_THEME, nullptr);
   }
 }
 
diff --git a/chrome/browser/themes/theme_service_unittest.cc b/chrome/browser/themes/theme_service_unittest.cc
index 2b35884..21d50fe 100644
--- a/chrome/browser/themes/theme_service_unittest.cc
+++ b/chrome/browser/themes/theme_service_unittest.cc
@@ -159,7 +159,6 @@
   // Now uninstall the extension, should revert to the default theme.
   service_->UninstallExtension(extension_id,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
   EXPECT_TRUE(theme_service->UsingDefaultTheme());
 }
diff --git a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
index 134212e2..4b0de8d 100644
--- a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
+++ b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
@@ -181,7 +181,6 @@
 TEST_F(ExtensionAppModelBuilderTest, Uninstall) {
   service_->UninstallExtension(kPackagedApp2Id,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
   EXPECT_EQ(std::string("Packaged App 1,Hosted App"),
             GetModelContent(model_.get()));
@@ -197,7 +196,6 @@
 
   service_->UninstallExtension(kPackagedApp2Id,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
   EXPECT_EQ(std::string("Packaged App 1,Hosted App"),
             GetModelContent(model_.get()));
diff --git a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
index 8af9d8f..831cefa7 100644
--- a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
+++ b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
@@ -206,7 +206,6 @@
   EXPECT_FALSE(results().empty());
   service_->UninstallExtension(kPackagedApp1Id,
                                extensions::UNINSTALL_REASON_FOR_TESTING,
-                               base::Bind(&base::DoNothing),
                                NULL);
 
   // Allow async AppSearchProvider::UpdateResults to run.
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index 97cc1bb..daeab0f 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -1247,7 +1247,6 @@
       browser()->profile())->extension_service();
   service->UninstallExtension(GetExtension()->id(),
                               extensions::UNINSTALL_REASON_FOR_TESTING,
-                              base::Bind(&base::DoNothing),
                               NULL);
   EXPECT_EQ(1, observer.closing_count());
 
diff --git a/chrome/browser/ui/extensions/extension_message_bubble_browsertest.cc b/chrome/browser/ui/extensions/extension_message_bubble_browsertest.cc
index 28c476da..7a40fbf 100644
--- a/chrome/browser/ui/extensions/extension_message_bubble_browsertest.cc
+++ b/chrome/browser/ui/extensions/extension_message_bubble_browsertest.cc
@@ -187,8 +187,7 @@
   CheckBubble(browser(), ANCHOR_BROWSER_ACTION, false);
 
   extension_service()->UninstallExtension(
-      extension->id(), extensions::UNINSTALL_REASON_FOR_TESTING,
-      base::Bind(&base::DoNothing), nullptr);
+      extension->id(), extensions::UNINSTALL_REASON_FOR_TESTING, nullptr);
   base::RunLoop().RunUntilIdle();
 
   // If the only relevant extension was uninstalled, the bubble should
@@ -214,8 +213,7 @@
   // Uninstall the extension before the bubble is shown. This should not crash,
   // and the bubble shouldn't be shown.
   extension_service()->UninstallExtension(
-      extension->id(), extensions::UNINSTALL_REASON_FOR_TESTING,
-      base::Bind(&base::DoNothing), nullptr);
+      extension->id(), extensions::UNINSTALL_REASON_FOR_TESTING, nullptr);
   base::RunLoop().RunUntilIdle();
   CheckBubbleIsNotPresent(second_browser, false, false);
 }
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_model_unittest.cc b/chrome/browser/ui/toolbar/toolbar_actions_model_unittest.cc
index f4951c0b..650e478 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_model_unittest.cc
@@ -521,7 +521,6 @@
   // Uninstall Extension B.
   service()->UninstallExtension(browser_action_b()->id(),
                                 extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing),
                                 NULL);  // Ignore error.
   // List contains only A and C now. Validate that.
   EXPECT_EQ(2u, num_toolbar_items());
@@ -760,7 +759,6 @@
   // highlight mode exiting.
   service()->UninstallExtension(browser_action_b()->id(),
                                 extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing),
                                 NULL);  // Ignore error.
   EXPECT_FALSE(toolbar_model()->is_highlighting());
   EXPECT_EQ(0, observer()->highlight_mode_count());
@@ -783,7 +781,6 @@
   // Uninstalling B should not have visible impact.
   service()->UninstallExtension(browser_action_b()->id(),
                                 extensions::UNINSTALL_REASON_FOR_TESTING,
-                                base::Bind(&base::DoNothing),
                                 NULL);  // Ignore error.
   EXPECT_TRUE(toolbar_model()->is_highlighting());
   EXPECT_EQ(1, observer()->highlight_mode_count());
@@ -1402,7 +1399,6 @@
   service()->UninstallExtension(
       browser_action_b()->id(),
       extensions::UNINSTALL_REASON_FOR_TESTING,
-      base::Bind(&base::DoNothing),
       nullptr);
   base::RunLoop().RunUntilIdle();
 
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
index 777c992..d0ad75c 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
@@ -150,7 +150,7 @@
         ->extension_service()
         ->UninstallExtension(
             app_id, extensions::UninstallReason::UNINSTALL_REASON_FOR_TESTING,
-            base::Closure(), NULL);
+            NULL);
   }
 
  protected:
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index f7b364b..c555fe4 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -575,7 +575,7 @@
     // Do the uninstall work here.
     extension_service_->UninstallExtension(
         extension_id_prompting_, extensions::UNINSTALL_REASON_USER_INITIATED,
-        base::Bind(&base::DoNothing), nullptr);
+        nullptr);
     CleanupAfterUninstall();
   } else {
     CreateExtensionUninstallDialog()->ConfirmUninstall(