Don't show the external extension install bubble for new profiles.

Because external installs are asynchronous, we need to keep count of the initial external installs for new profiles to know when they're done.

BUG=229083

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196066 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index c227e2dc..796066f0 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -356,6 +356,7 @@
       update_once_all_providers_are_ready_(false),
       browser_terminating_(false),
       installs_delayed_(false),
+      is_first_run_(false),
       app_sync_bundle_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
       extension_sync_bundle_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
   CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -1760,9 +1761,10 @@
   // notification.
   extension_error_ui_.reset(ExtensionErrorUI::Create(this));
 
+  is_first_run_ = !extension_prefs_->SetAlertSystemFirstRun();
   bool did_show_alert = false;
   if (PopulateExtensionErrorUI(extension_error_ui_.get())) {
-    if (extension_prefs_->SetAlertSystemFirstRun()) {
+    if (!is_first_run_) {
       CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
       did_show_alert = extension_error_ui_->ShowErrorInBubbleView();
     } else {
@@ -1875,7 +1877,7 @@
                                   EXTERNAL_EXTENSION_BUCKET_BOUNDARY);
         return;
       }
-      extensions::AddExternalInstallError(this, extension);
+      extensions::AddExternalInstallError(this, extension, is_first_run_);
     }
   } else {
     extensions::RemoveExternalInstallError(this);