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

Side by Side Diff: chrome/browser/chromeos/extensions/external_cache.cc

Issue 2299203004: Attempt to repair corrupt enterprise policy force-installed extensions (Closed)
Patch Set: fix chromeos compile problem Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 cached_extensions_->Clear(); 237 cached_extensions_->Clear();
238 for (base::DictionaryValue::Iterator it(*extensions_.get()); 238 for (base::DictionaryValue::Iterator it(*extensions_.get());
239 !it.IsAtEnd(); it.Advance()) { 239 !it.IsAtEnd(); it.Advance()) {
240 const base::DictionaryValue* entry = NULL; 240 const base::DictionaryValue* entry = NULL;
241 if (!it.value().GetAsDictionary(&entry)) { 241 if (!it.value().GetAsDictionary(&entry)) {
242 LOG(ERROR) << "ExternalCache found bad entry with type " 242 LOG(ERROR) << "ExternalCache found bad entry with type "
243 << it.value().GetType(); 243 << it.value().GetType();
244 continue; 244 continue;
245 } 245 }
246 246
247 bool keep_if_present = 247 bool keep_if_present =
lazyboy 2016/09/02 19:21:52 unrelated to this CL, but generally I'd have expec
asargent_no_longer_on_chrome 2016/09/09 03:30:43 I guess it just means that "keep_if_present" is a
248 entry->HasKey(extensions::ExternalProviderImpl::kKeepIfPresent); 248 entry->HasKey(extensions::ExternalProviderImpl::kKeepIfPresent);
249 std::string external_update_url; 249 std::string external_update_url;
250 entry->GetString(extensions::ExternalProviderImpl::kExternalUpdateUrl, 250 entry->GetString(extensions::ExternalProviderImpl::kExternalUpdateUrl,
251 &external_update_url); 251 &external_update_url);
252 if (downloader_ && !keep_if_present) { 252 if (downloader_ && !keep_if_present) {
253 GURL update_url; 253 GURL update_url;
254 if (!external_update_url.empty()) 254 if (!external_update_url.empty())
255 update_url = GURL(external_update_url); 255 update_url = GURL(external_update_url);
256 else if (always_check_updates_) 256 else if (always_check_updates_)
257 update_url = extension_urls::GetWebstoreUpdateUrl(); 257 update_url = extension_urls::GetWebstoreUpdateUrl();
258 258
259 if (update_url.is_valid()) 259 if (update_url.is_valid())
260 downloader_->AddPendingExtension(it.key(), update_url, 0); 260 downloader_->AddPendingExtension(it.key(), update_url, false, 0);
261 } 261 }
262 262
263 base::FilePath file_path; 263 base::FilePath file_path;
264 std::string version; 264 std::string version;
265 std::string hash; 265 std::string hash;
266 if (local_cache_.GetExtension(it.key(), hash, &file_path, &version)) { 266 if (local_cache_.GetExtension(it.key(), hash, &file_path, &version)) {
267 // Copy entry to don't modify it inside extensions_. 267 // Copy entry to don't modify it inside extensions_.
268 base::DictionaryValue* entry_copy = entry->DeepCopy(); 268 base::DictionaryValue* entry_copy = entry->DeepCopy();
269 269
270 if (extension_urls::IsWebstoreUpdateUrl(GURL(external_update_url))) { 270 if (extension_urls::IsWebstoreUpdateUrl(GURL(external_update_url))) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 OnPutExtension(id, file_path, file_ownership_passed); 358 OnPutExtension(id, file_path, file_ownership_passed);
359 callback.Run(id, !file_ownership_passed); 359 callback.Run(id, !file_ownership_passed);
360 } 360 }
361 361
362 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( 362 std::string ExternalCache::Delegate::GetInstalledExtensionVersion(
363 const std::string& id) { 363 const std::string& id) {
364 return std::string(); 364 return std::string();
365 } 365 }
366 366
367 } // namespace chromeos 367 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698