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