Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: chrome/browser/extensions/external_pref_loader.cc

Issue 650763003: Delay default apps installation on Chrome OS for first time sign-in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/external_pref_loader.cc
diff --git a/chrome/browser/extensions/external_pref_loader.cc b/chrome/browser/extensions/external_pref_loader.cc
index 9a32ac34426b0a623573cd45e60c32fe043eccbf..27228d09d8fcd155d39e494d204d7d90a378e757 100644
--- a/chrome/browser/extensions/external_pref_loader.cc
+++ b/chrome/browser/extensions/external_pref_loader.cc
@@ -25,6 +25,10 @@ namespace {
base::FilePath::CharType kExternalExtensionJson[] =
FILE_PATH_LITERAL("external_extensions.json");
+// Keep this delay greater or close to priority settings sync timeout (10 sec)
Nikita (slow) 2014/10/23 14:22:47 For the reference: kSyncTimeoutSeconds.
asargent_no_longer_on_chrome 2014/10/23 22:34:35 optional: Is it worth putting this constant name i
Dmitry Polukhin 2014/10/24 11:40:42 Removed this constant.
+// on Chrome OS login.
+const int kMsDelayPrefLoad = 15 * 1000;
+
std::set<base::FilePath> GetPrefsCandidateFilesFromFolder(
const base::FilePath& external_extension_search_path) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
@@ -104,9 +108,16 @@ const base::FilePath ExternalPrefLoader::GetBaseCrxFilePath() {
void ExternalPrefLoader::StartLoading() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- BrowserThread::PostTask(
- BrowserThread::FILE, FROM_HERE,
- base::Bind(&ExternalPrefLoader::LoadOnFileThread, this));
+ if (options_ & DELAY_LOAD) {
+ BrowserThread::PostDelayedTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&ExternalPrefLoader::LoadOnFileThread, this),
+ base::TimeDelta::FromMillisecondsD(kMsDelayPrefLoad));
+ } else {
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&ExternalPrefLoader::LoadOnFileThread, this));
+ }
}
void ExternalPrefLoader::LoadOnFileThread() {

Powered by Google App Engine
This is Rietveld 408576698