cros: Add a InstallLimiter PKS to control default app install on cros.
There are two big apps in cros default apps. They take 54M compressed and 247M
uncompressed. Installing those two causes disk thrashing and slows down
everything for first-time login. As a result, user would not be able to see any
other default apps for about 20-25s. This CL improves user experience a bit by
deferring the two big apps install and letting user see/use other apps sooner.
BUG=166296
TEST=Verify default app icons on launcher bar shows up in about 4s for
first-time login user on daisy.
[email protected],[email protected]
[email protected] for chrome/chrome_browser_chromeos.gypi
Review URL: https://chromiumcodereview.appspot.com/11879028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177341 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 7170f63a..f8f3a234 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -111,9 +111,7 @@
#include "webkit/database/database_util.h"
#if defined(OS_CHROMEOS)
-#include "chrome/browser/chromeos/cros/cros_library.h"
-#include "chrome/browser/chromeos/input_method/input_method_manager.h"
-#include "content/public/browser/storage_partition.h"
+#include "chrome/browser/chromeos/extensions/install_limiter.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_mount_point_provider.h"
#endif
@@ -2606,7 +2604,11 @@
installer->set_expected_version(*version);
installer->set_install_cause(extension_misc::INSTALL_CAUSE_EXTERNAL_FILE);
installer->set_creation_flags(creation_flags);
+#if defined(OS_CHROMEOS)
+ extensions::InstallLimiter::Get(profile_)->Add(installer, path);
+#else
installer->InstallCrx(path);
+#endif
// Depending on the source, a new external extension might not need a user
// notification on installation. For such extensions, mark them acknowledged