OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/extensions/external_cache.h" | 5 #include "chrome/browser/chromeos/extensions/external_cache.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 delegate_->OnExtensionListsUpdated(cached_extensions_.get()); | 203 delegate_->OnExtensionListsUpdated(cached_extensions_.get()); |
204 } | 204 } |
205 | 205 |
206 void ExternalCache::CheckCache() { | 206 void ExternalCache::CheckCache() { |
207 if (local_cache_.is_shutdown()) | 207 if (local_cache_.is_shutdown()) |
208 return; | 208 return; |
209 | 209 |
210 // If request_context_ is missing we can't download anything. | 210 // If request_context_ is missing we can't download anything. |
211 if (!downloader_ && request_context_) { | 211 if (!downloader_ && request_context_) { |
212 downloader_.reset( | 212 downloader_.reset( |
213 new extensions::ExtensionDownloader(this, request_context_)); | 213 new extensions::ExtensionDownloader(this, request_context_, NULL)); |
214 } | 214 } |
215 | 215 |
216 cached_extensions_->Clear(); | 216 cached_extensions_->Clear(); |
217 for (base::DictionaryValue::Iterator it(*extensions_.get()); | 217 for (base::DictionaryValue::Iterator it(*extensions_.get()); |
218 !it.IsAtEnd(); it.Advance()) { | 218 !it.IsAtEnd(); it.Advance()) { |
219 const base::DictionaryValue* entry = NULL; | 219 const base::DictionaryValue* entry = NULL; |
220 if (!it.value().GetAsDictionary(&entry)) { | 220 if (!it.value().GetAsDictionary(&entry)) { |
221 LOG(ERROR) << "ExternalCache found bad entry with type " | 221 LOG(ERROR) << "ExternalCache found bad entry with type " |
222 << it.value().GetType(); | 222 << it.value().GetType(); |
223 continue; | 223 continue; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 delegate_->OnExtensionLoadedInCache(id); | 320 delegate_->OnExtensionLoadedInCache(id); |
321 UpdateExtensionLoader(); | 321 UpdateExtensionLoader(); |
322 } | 322 } |
323 | 323 |
324 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( | 324 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( |
325 const std::string& id) { | 325 const std::string& id) { |
326 return std::string(); | 326 return std::string(); |
327 } | 327 } |
328 | 328 |
329 } // namespace chromeos | 329 } // namespace chromeos |
OLD | NEW |