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