Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / extensions / external_pref_cache_loader.h
blob72e8d87d44f46cd390569300424a65399b48a514
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"
11 class Profile;
13 namespace chromeos {
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 {
20 public:
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);
29 private:
30 friend class base::RefCountedThreadSafe<ExternalLoader>;
32 virtual ~ExternalPrefCacheLoader();
34 virtual void StartLoading() OVERRIDE;
35 virtual void LoadFinished() OVERRIDE;
37 Profile* profile_;
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_