Retry reinstallation of corrupted policy extensions.

Introduce a new class PolicyExtensionReinstaller, that contains the
logic for retrying with a backoff.

Note that the backoff entries were per-extension before, I'm making
it global. Two reasons:
1) The per entry backoff was added primarily to stop
an extension from being continually reinstalling if the verification
for that extension kept failing. With the global backoff, it should
still hold. (crbug.com/661738)
2) Even if the entry is backoff, we call
ExtensionService::CheckForExternalUpdates() in the end, which applies
to *all* policy extensions, not just the one that corrupted.

BUG=703904
Test=Turn off network, corrupt a policy installed extension (easy to
modify a file/background script in extension's installation directory).
Turn the network back on, after a while extension should be reinstalled.

Review-Url: https://codereview.chromium.org/2790823004
Cr-Commit-Position: refs/heads/master@{#461748}
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 50c00cf..06617e6d 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1327,6 +1327,9 @@
 // Errors are reported through ExtensionErrorReporter. Success is not
 // reported.
 void ExtensionService::CheckForExternalUpdates() {
+  if (external_updates_disabled_for_test_)
+    return;
+
   CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   TRACE_EVENT0("browser,startup", "ExtensionService::CheckForExternalUpdates");
   SCOPED_UMA_HISTOGRAM_TIMER("Extensions.CheckForExternalUpdatesTime");