| OLD | NEW |
| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 version)); | 190 version)); |
| 191 } | 191 } |
| 192 | 192 |
| 193 bool ExternalCache::IsExtensionPending(const std::string& id) { | 193 bool ExternalCache::IsExtensionPending(const std::string& id) { |
| 194 // Pending means that there is no installed version yet. | 194 // Pending means that there is no installed version yet. |
| 195 return extensions_->HasKey(id) && !cached_extensions_->HasKey(id); | 195 return extensions_->HasKey(id) && !cached_extensions_->HasKey(id); |
| 196 } | 196 } |
| 197 | 197 |
| 198 bool ExternalCache::GetExtensionExistingVersion(const std::string& id, | 198 bool ExternalCache::GetExtensionExistingVersion(const std::string& id, |
| 199 std::string* version) { | 199 std::string* version) { |
| 200 DictionaryValue* extension_dictionary = NULL; | 200 base::DictionaryValue* extension_dictionary = NULL; |
| 201 if (cached_extensions_->GetDictionary(id, &extension_dictionary)) { | 201 if (cached_extensions_->GetDictionary(id, &extension_dictionary)) { |
| 202 if (extension_dictionary->GetString( | 202 if (extension_dictionary->GetString( |
| 203 extensions::ExternalProviderImpl::kExternalVersion, version)) { | 203 extensions::ExternalProviderImpl::kExternalVersion, version)) { |
| 204 return true; | 204 return true; |
| 205 } | 205 } |
| 206 *version = delegate_->GetInstalledExtensionVersion(id); | 206 *version = delegate_->GetInstalledExtensionVersion(id); |
| 207 return !version->empty(); | 207 return !version->empty(); |
| 208 } | 208 } |
| 209 return false; | 209 return false; |
| 210 } | 210 } |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 FROM_HERE, | 554 FROM_HERE, |
| 555 callback); | 555 callback); |
| 556 } | 556 } |
| 557 | 557 |
| 558 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( | 558 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( |
| 559 const std::string& id) { | 559 const std::string& id) { |
| 560 return std::string(); | 560 return std::string(); |
| 561 } | 561 } |
| 562 | 562 |
| 563 } // namespace chromeos | 563 } // namespace chromeos |
| OLD | NEW |