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