| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 namespace { | 548 namespace { |
| 549 // TODO(akalin): Put this somewhere where both crx_installer.cc and | 549 // TODO(akalin): Put this somewhere where both crx_installer.cc and |
| 550 // this file can use it. | 550 // this file can use it. |
| 551 void DeleteFileHelper(const FilePath& path, bool recursive) { | 551 void DeleteFileHelper(const FilePath& path, bool recursive) { |
| 552 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 552 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 553 file_util::Delete(path, recursive); | 553 file_util::Delete(path, recursive); |
| 554 } | 554 } |
| 555 } // namespace | 555 } // namespace |
| 556 | 556 |
| 557 void ExtensionService::UpdateExtension(const std::string& id, | 557 void ExtensionService::UpdateExtension(const std::string& id, |
| 558 const FilePath& extension_path, | 558 const FilePath& extension_path, |
| 559 const GURL& download_url) { | 559 const GURL& download_url) { |
| 560 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 560 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 561 | 561 |
| 562 PendingExtensionMap::const_iterator it = pending_extensions_.find(id); | 562 PendingExtensionMap::const_iterator it = pending_extensions_.find(id); |
| 563 bool is_pending_extension = (it != pending_extensions_.end()); | 563 bool is_pending_extension = (it != pending_extensions_.end()); |
| 564 | 564 |
| 565 const Extension* extension = GetExtensionByIdInternal(id, true, true); | 565 const Extension* extension = GetExtensionByIdInternal(id, true, true); |
| 566 if (!is_pending_extension && !extension) { | 566 if (!is_pending_extension && !extension) { |
| 567 LOG(WARNING) << "Will not update extension " << id | 567 LOG(WARNING) << "Will not update extension " << id |
| 568 << " because it is not installed or pending"; | 568 << " because it is not installed or pending"; |
| 569 // Delete extension_path since we're not creating a CrxInstaller | 569 // Delete extension_path since we're not creating a CrxInstaller |
| (...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 } | 1978 } |
| 1979 | 1979 |
| 1980 void ExtensionService::SetBeingUpgraded(const Extension* extension, | 1980 void ExtensionService::SetBeingUpgraded(const Extension* extension, |
| 1981 bool value) { | 1981 bool value) { |
| 1982 extension_runtime_data_[extension->id()].being_upgraded = value; | 1982 extension_runtime_data_[extension->id()].being_upgraded = value; |
| 1983 } | 1983 } |
| 1984 | 1984 |
| 1985 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { | 1985 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { |
| 1986 return &extension_runtime_data_[extension->id()].property_bag; | 1986 return &extension_runtime_data_[extension->id()].property_bag; |
| 1987 } | 1987 } |
| OLD | NEW |