OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 namespace { | 670 namespace { |
671 // TODO(akalin): Put this somewhere where both crx_installer.cc and | 671 // TODO(akalin): Put this somewhere where both crx_installer.cc and |
672 // this file can use it. | 672 // this file can use it. |
673 void DeleteFileHelper(const FilePath& path, bool recursive) { | 673 void DeleteFileHelper(const FilePath& path, bool recursive) { |
674 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 674 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
675 file_util::Delete(path, recursive); | 675 file_util::Delete(path, recursive); |
676 } | 676 } |
677 } // namespace | 677 } // namespace |
678 | 678 |
679 void ExtensionService::UpdateExtension(const std::string& id, | 679 void ExtensionService::UpdateExtension(const std::string& id, |
680 const FilePath& extension_path, | 680 const FilePath& extension_path, |
681 const GURL& download_url) { | 681 const GURL& download_url) { |
682 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 682 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
683 | 683 |
684 PendingExtensionMap::const_iterator it = pending_extensions_.find(id); | 684 PendingExtensionMap::const_iterator it = pending_extensions_.find(id); |
685 bool is_pending_extension = (it != pending_extensions_.end()); | 685 bool is_pending_extension = (it != pending_extensions_.end()); |
686 | 686 |
687 const Extension* extension = GetExtensionByIdInternal(id, true, true); | 687 const Extension* extension = GetExtensionByIdInternal(id, true, true); |
688 if (!is_pending_extension && !extension) { | 688 if (!is_pending_extension && !extension) { |
689 LOG(WARNING) << "Will not update extension " << id | 689 LOG(WARNING) << "Will not update extension " << id |
690 << " because it is not installed or pending"; | 690 << " because it is not installed or pending"; |
691 // Delete extension_path since we're not creating a CrxInstaller | 691 // Delete extension_path since we're not creating a CrxInstaller |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2066 } | 2066 } |
2067 | 2067 |
2068 void ExtensionService::SetBeingUpgraded(const Extension* extension, | 2068 void ExtensionService::SetBeingUpgraded(const Extension* extension, |
2069 bool value) { | 2069 bool value) { |
2070 extension_runtime_data_[extension->id()].being_upgraded = value; | 2070 extension_runtime_data_[extension->id()].being_upgraded = value; |
2071 } | 2071 } |
2072 | 2072 |
2073 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { | 2073 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { |
2074 return &extension_runtime_data_[extension->id()].property_bag; | 2074 return &extension_runtime_data_[extension->id()].property_bag; |
2075 } | 2075 } |
OLD | NEW |