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" |
11 #include "base/files/file_enumerator.h" | 11 #include "base/files/file_enumerator.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "base/version.h" | 16 #include "base/version.h" |
17 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
18 #include "chrome/browser/extensions/crx_installer.h" | 18 #include "chrome/browser/extensions/crx_installer.h" |
19 #include "chrome/browser/extensions/external_provider_impl.h" | 19 #include "chrome/browser/extensions/external_provider_impl.h" |
20 #include "chrome/browser/extensions/updater/extension_downloader.h" | 20 #include "chrome/browser/extensions/updater/extension_downloader.h" |
21 #include "chrome/common/extensions/extension_constants.h" | 21 #include "chrome/common/extensions/extension_constants.h" |
22 #include "content/public/browser/browser_thread.h" | |
23 #include "content/public/browser/notification_details.h" | 22 #include "content/public/browser/notification_details.h" |
24 #include "content/public/browser/notification_service.h" | 23 #include "content/public/browser/notification_service.h" |
25 #include "content/public/browser/notification_source.h" | 24 #include "content/public/browser/notification_source.h" |
26 #include "extensions/common/extension.h" | 25 #include "extensions/common/extension.h" |
27 #include "net/url_request/url_request_context_getter.h" | 26 #include "net/url_request/url_request_context_getter.h" |
28 | 27 |
29 namespace chromeos { | 28 namespace chromeos { |
30 | 29 |
31 ExternalCache::ExternalCache(const base::FilePath& cache_dir, | 30 ExternalCache::ExternalCache(const base::FilePath& cache_dir, |
32 net::URLRequestContextGetter* request_context, | 31 net::URLRequestContextGetter* request_context, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (!it.value().GetAsDictionary(&entry)) { | 84 if (!it.value().GetAsDictionary(&entry)) { |
86 NOTREACHED() << "ExternalCache found bad entry with type " | 85 NOTREACHED() << "ExternalCache found bad entry with type " |
87 << it.value().GetType(); | 86 << it.value().GetType(); |
88 continue; | 87 continue; |
89 } | 88 } |
90 | 89 |
91 std::string external_crx; | 90 std::string external_crx; |
92 if (entry->GetString(extensions::ExternalProviderImpl::kExternalCrx, | 91 if (entry->GetString(extensions::ExternalProviderImpl::kExternalCrx, |
93 &external_crx) && | 92 &external_crx) && |
94 external_crx == path.value()) { | 93 external_crx == path.value()) { |
95 | |
96 std::string id = it.key(); | 94 std::string id = it.key(); |
97 LOG(ERROR) << "ExternalCache extension at " << path.value() | 95 LOG(ERROR) << "ExternalCache extension at " << path.value() |
98 << " failed to install, deleting it."; | 96 << " failed to install, deleting it."; |
99 cached_extensions_->Remove(id, NULL); | 97 cached_extensions_->Remove(id, NULL); |
100 extensions_->Remove(id, NULL); | 98 extensions_->Remove(id, NULL); |
101 | 99 |
102 local_cache_.RemoveExtension(id); | 100 local_cache_.RemoveExtension(id); |
103 UpdateExtensionLoader(); | 101 UpdateExtensionLoader(); |
104 | 102 |
105 // Don't try to DownloadMissingExtensions() from here, | 103 // Don't try to DownloadMissingExtensions() from here, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 cached_extensions_->Set(id, entry); | 295 cached_extensions_->Set(id, entry); |
298 UpdateExtensionLoader(); | 296 UpdateExtensionLoader(); |
299 } | 297 } |
300 | 298 |
301 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( | 299 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( |
302 const std::string& id) { | 300 const std::string& id) { |
303 return std::string(); | 301 return std::string(); |
304 } | 302 } |
305 | 303 |
306 } // namespace chromeos | 304 } // namespace chromeos |
OLD | NEW |