| 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 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_CACHE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_CACHE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_CACHE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_CACHE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 virtual ~ExternalCache(); | 76 virtual ~ExternalCache(); |
| 77 | 77 |
| 78 // Returns already cached extensions. | 78 // Returns already cached extensions. |
| 79 const base::DictionaryValue* cached_extensions() { | 79 const base::DictionaryValue* cached_extensions() { |
| 80 return cached_extensions_.get(); | 80 return cached_extensions_.get(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 // Implementation of content::NotificationObserver: | 83 // Implementation of content::NotificationObserver: |
| 84 virtual void Observe(int type, | 84 virtual void Observe(int type, |
| 85 const content::NotificationSource& source, | 85 const content::NotificationSource& source, |
| 86 const content::NotificationDetails& details) OVERRIDE; | 86 const content::NotificationDetails& details) override; |
| 87 | 87 |
| 88 // Implementation of ExtensionDownloaderDelegate: | 88 // Implementation of ExtensionDownloaderDelegate: |
| 89 virtual void OnExtensionDownloadFailed( | 89 virtual void OnExtensionDownloadFailed( |
| 90 const std::string& id, | 90 const std::string& id, |
| 91 Error error, | 91 Error error, |
| 92 const PingResult& ping_result, | 92 const PingResult& ping_result, |
| 93 const std::set<int>& request_ids) OVERRIDE; | 93 const std::set<int>& request_ids) override; |
| 94 | 94 |
| 95 virtual void OnExtensionDownloadFinished( | 95 virtual void OnExtensionDownloadFinished( |
| 96 const std::string& id, | 96 const std::string& id, |
| 97 const base::FilePath& path, | 97 const base::FilePath& path, |
| 98 bool file_ownership_passed, | 98 bool file_ownership_passed, |
| 99 const GURL& download_url, | 99 const GURL& download_url, |
| 100 const std::string& version, | 100 const std::string& version, |
| 101 const PingResult& ping_result, | 101 const PingResult& ping_result, |
| 102 const std::set<int>& request_ids) OVERRIDE; | 102 const std::set<int>& request_ids) override; |
| 103 | 103 |
| 104 virtual bool IsExtensionPending(const std::string& id) OVERRIDE; | 104 virtual bool IsExtensionPending(const std::string& id) override; |
| 105 | 105 |
| 106 virtual bool GetExtensionExistingVersion(const std::string& id, | 106 virtual bool GetExtensionExistingVersion(const std::string& id, |
| 107 std::string* version) OVERRIDE; | 107 std::string* version) override; |
| 108 | 108 |
| 109 // Shut down the cache. The |callback| will be invoked when the cache has shut | 109 // Shut down the cache. The |callback| will be invoked when the cache has shut |
| 110 // down completely and there are no more pending file I/O operations. | 110 // down completely and there are no more pending file I/O operations. |
| 111 void Shutdown(const base::Closure& callback); | 111 void Shutdown(const base::Closure& callback); |
| 112 | 112 |
| 113 // Replace the list of extensions to cache with |prefs| and perform update | 113 // Replace the list of extensions to cache with |prefs| and perform update |
| 114 // checks for these. | 114 // checks for these. |
| 115 void UpdateExtensionsList(scoped_ptr<base::DictionaryValue> prefs); | 115 void UpdateExtensionsList(scoped_ptr<base::DictionaryValue> prefs); |
| 116 | 116 |
| 117 // If a user of one of the ExternalCache's extensions detects that | 117 // If a user of one of the ExternalCache's extensions detects that |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 // Weak factory for callbacks. | 190 // Weak factory for callbacks. |
| 191 base::WeakPtrFactory<ExternalCache> weak_ptr_factory_; | 191 base::WeakPtrFactory<ExternalCache> weak_ptr_factory_; |
| 192 | 192 |
| 193 DISALLOW_COPY_AND_ASSIGN(ExternalCache); | 193 DISALLOW_COPY_AND_ASSIGN(ExternalCache); |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 } // namespace chromeos | 196 } // namespace chromeos |
| 197 | 197 |
| 198 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_CACHE_H_ | 198 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_CACHE_H_ |
| OLD | NEW |