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

Side by Side Diff: chrome/browser/extensions/updater/extension_updater.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/updater/extension_updater.h" 5 #include "chrome/browser/extensions/updater/extension_updater.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 pending_extension_manager->GetPendingIdsForUpdateCheck(&pending_ids); 351 pending_extension_manager->GetPendingIdsForUpdateCheck(&pending_ids);
352 352
353 std::list<std::string>::const_iterator iter; 353 std::list<std::string>::const_iterator iter;
354 for (iter = pending_ids.begin(); iter != pending_ids.end(); ++iter) { 354 for (iter = pending_ids.begin(); iter != pending_ids.end(); ++iter) {
355 const PendingExtensionInfo* info = pending_extension_manager->GetById( 355 const PendingExtensionInfo* info = pending_extension_manager->GetById(
356 *iter); 356 *iter);
357 if (!Manifest::IsAutoUpdateableLocation(info->install_source())) { 357 if (!Manifest::IsAutoUpdateableLocation(info->install_source())) {
358 VLOG(2) << "Extension " << *iter << " is not auto updateable"; 358 VLOG(2) << "Extension " << *iter << " is not auto updateable";
359 continue; 359 continue;
360 } 360 }
361 if (downloader_->AddPendingExtension(*iter, info->update_url(), 361 if (downloader_->AddPendingExtension(
362 request_id)) 362 *iter, info->update_url(),
363 pending_extension_manager->IsPolicyReinstallExpected(*iter),
364 request_id))
363 request.in_progress_ids_.push_back(*iter); 365 request.in_progress_ids_.push_back(*iter);
364 } 366 }
365 367
366 ExtensionRegistry* registry = ExtensionRegistry::Get(profile_); 368 ExtensionRegistry* registry = ExtensionRegistry::Get(profile_);
367 AddToDownloader(&registry->enabled_extensions(), pending_ids, request_id); 369 AddToDownloader(&registry->enabled_extensions(), pending_ids, request_id);
368 AddToDownloader(&registry->disabled_extensions(), pending_ids, request_id); 370 AddToDownloader(&registry->disabled_extensions(), pending_ids, request_id);
369 } else { 371 } else {
370 for (std::list<std::string>::const_iterator it = params.ids.begin(); 372 for (std::list<std::string>::const_iterator it = params.ids.begin();
371 it != params.ids.end(); ++it) { 373 it != params.ids.end(); ++it) {
372 const Extension* extension = service_->GetExtensionById(*it, true); 374 const Extension* extension = service_->GetExtensionById(*it, true);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 const InProgressCheck& request = requests_in_progress_[request_id]; 597 const InProgressCheck& request = requests_in_progress_[request_id];
596 if (request.in_progress_ids_.empty()) { 598 if (request.in_progress_ids_.empty()) {
597 VLOG(2) << "Finished update check " << request_id; 599 VLOG(2) << "Finished update check " << request_id;
598 if (!request.callback.is_null()) 600 if (!request.callback.is_null())
599 request.callback.Run(); 601 request.callback.Run();
600 requests_in_progress_.erase(request_id); 602 requests_in_progress_.erase(request_id);
601 } 603 }
602 } 604 }
603 605
604 } // namespace extensions 606 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698