| 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_PREF_CACHE_LOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_PREF_CACHE_LOADER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_PREF_CACHE_LOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_PREF_CACHE_LOADER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" |
| 8 #include "chrome/browser/extensions/external_pref_loader.h" | 9 #include "chrome/browser/extensions/external_pref_loader.h" |
| 9 | 10 |
| 10 class Profile; | 11 class Profile; |
| 11 | 12 |
| 12 namespace chromeos { | 13 namespace chromeos { |
| 13 | 14 |
| 15 class ExternalCacheDispatcher; |
| 16 |
| 14 // A specialization of the ExternalPrefLoader that caches crx files for external | 17 // A specialization of the ExternalPrefLoader that caches crx files for external |
| 15 // extensions with update URL in a common place for all users on the machine. | 18 // extensions with update URL in a common place for all users on the machine. |
| 16 class ExternalPrefCacheLoader : public extensions::ExternalPrefLoader { | 19 class ExternalPrefCacheLoader : public extensions::ExternalPrefLoader { |
| 17 public: | 20 public: |
| 18 // All instances of ExternalPrefCacheLoader use the same cache so | 21 // All instances of ExternalPrefCacheLoader use the same cache so |
| 19 // |base_path_id| must be the same for all profile in session. | 22 // |base_path_id| must be the same for all profile in session. |
| 20 // It is checked in run-time with CHECK. |profile| is used to check if the | 23 // It is checked in run-time with CHECK. |profile| is used to check if the |
| 21 // extension is installed to keep providing. | 24 // extension is installed to keep providing. |
| 22 ExternalPrefCacheLoader(int base_path_id, Profile* profile); | 25 ExternalPrefCacheLoader(int base_path_id, Profile* profile); |
| 23 | 26 |
| 24 void OnExtensionListsUpdated(const base::DictionaryValue* prefs); | 27 void OnExtensionListsUpdated(const base::DictionaryValue* prefs); |
| 25 | 28 |
| 26 private: | 29 private: |
| 27 friend class base::RefCountedThreadSafe<ExternalLoader>; | 30 friend class base::RefCountedThreadSafe<ExternalLoader>; |
| 28 | 31 |
| 29 virtual ~ExternalPrefCacheLoader(); | 32 virtual ~ExternalPrefCacheLoader(); |
| 30 | 33 |
| 31 virtual void StartLoading() OVERRIDE; | 34 virtual void StartLoading() OVERRIDE; |
| 32 virtual void LoadFinished() OVERRIDE; | 35 virtual void LoadFinished() OVERRIDE; |
| 33 | 36 |
| 34 Profile* profile_; | 37 Profile* profile_; |
| 38 scoped_refptr<ExternalCacheDispatcher> cache_dispatcher_; |
| 35 | 39 |
| 36 DISALLOW_COPY_AND_ASSIGN(ExternalPrefCacheLoader); | 40 DISALLOW_COPY_AND_ASSIGN(ExternalPrefCacheLoader); |
| 37 }; | 41 }; |
| 38 | 42 |
| 39 } // namespace chromeos | 43 } // namespace chromeos |
| 40 | 44 |
| 41 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_PREF_CACHE_LOADER_H_ | 45 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_EXTERNAL_PREF_CACHE_LOADER_H_ |
| OLD | NEW |