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

Unified Diff: chrome/browser/chromeos/extensions/external_cache.cc

Issue 269573010: Download and cache kiosk app extension when it is added via kiosk mamangement ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add code review comments. Created 6 years, 8 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/chromeos/extensions/external_cache.cc
diff --git a/chrome/browser/chromeos/extensions/external_cache.cc b/chrome/browser/chromeos/extensions/external_cache.cc
index 5b547a425f3729ff417c943c1876b7ab054c63a4..5eb9e042123cd14597ccac85f072170ead62f293 100644
--- a/chrome/browser/chromeos/extensions/external_cache.cc
+++ b/chrome/browser/chromeos/extensions/external_cache.cc
@@ -108,6 +108,18 @@ void ExternalCache::OnDamagedFileDetected(const base::FilePath& path) {
LOG(ERROR) << "ExternalCache cannot find external_crx " << path.value();
}
+void ExternalCache::RemoveExtensions(const std::vector<std::string>& ids) {
+ if (ids.size() == 0)
xiyuan 2014/05/02 18:33:51 nit: ids.empty()
jennyz 2014/05/02 21:05:04 Done.
+ return;
+
+ for (size_t i = 0; i < ids.size(); ++i) {
+ cached_extensions_->Remove(ids[i], NULL);
+ extensions_->Remove(ids[i], NULL);
+ local_cache_.RemoveExtension(ids[i]);
+ }
+ UpdateExtensionLoader();
+}
+
void ExternalCache::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
@@ -133,10 +145,14 @@ void ExternalCache::OnExtensionDownloadFailed(
if (!cached_extensions_->HasKey(id)) {
LOG(ERROR) << "ExternalCache extension " << id
<< " not found on update server";
+ delegate_->OnExtensionDownloadFailed(id, error);
+ } else {
+ delegate_->OnExtensionLoadedInCache(id);
}
} else {
LOG(ERROR) << "ExternalCache failed to download extension " << id
<< ", error " << error;
+ delegate_->OnExtensionDownloadFailed(id, error);
}
}
@@ -293,6 +309,8 @@ void ExternalCache::OnPutExtension(const std::string& id,
file_path.value());
cached_extensions_->Set(id, entry);
+ if (delegate_)
+ delegate_->OnExtensionLoadedInCache(id);
UpdateExtensionLoader();
}

Powered by Google App Engine
This is Rietveld 408576698