Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2010 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_LOADER_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_LOADER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/extensions/external_extension_loader.h" | |
| 10 | |
| 11 #include <string> | |
| 12 | |
| 13 #include "base/scoped_ptr.h" | |
| 14 #include "base/values.h" | |
| 15 | |
| 16 // A specialization of the ExternalExtensionLoader that uses a json file to | |
| 17 // look up which external extensions are registered. | |
| 18 // Instances of this class are expected to be created and destroyed on the UI | |
| 19 // thread and they are expecting public method calls from the UI thread. | |
| 20 class ExternalPrefExtensionLoader : public ExternalExtensionLoader { | |
| 21 public: | |
| 22 explicit ExternalPrefExtensionLoader(); | |
|
jochen (gone - plz use gerrit)
2011/01/04 12:38:01
no explicit
gfeher
2011/01/04 23:37:09
Done.
| |
| 23 | |
| 24 protected: | |
| 25 virtual void Load(); | |
| 26 | |
| 27 private: | |
| 28 friend class base::RefCountedThreadSafe<ExternalExtensionLoader>; | |
| 29 | |
| 30 virtual ~ExternalPrefExtensionLoader() {} | |
| 31 | |
| 32 void LoadOnFileThread(); | |
| 33 }; | |
|
jochen (gone - plz use gerrit)
2011/01/04 12:38:01
disallow copy and assign?
gfeher
2011/01/04 23:37:09
Done.
| |
| 34 | |
| 35 // A simplified version of ExternalPrefExtensionLoader that loads the dictionary | |
| 36 // from json data specified in a string. | |
| 37 class ExternalTestingExtensionLoader : public ExternalExtensionLoader { | |
| 38 public: | |
| 39 explicit ExternalTestingExtensionLoader(const std::string& json_data); | |
| 40 | |
| 41 protected: | |
| 42 virtual void Load(); | |
| 43 | |
| 44 private: | |
| 45 friend class base::RefCountedThreadSafe<ExternalExtensionLoader>; | |
| 46 | |
| 47 virtual ~ExternalTestingExtensionLoader() {} | |
| 48 | |
| 49 scoped_ptr<DictionaryValue> testing_prefs_; | |
| 50 | |
| 51 }; | |
|
jochen (gone - plz use gerrit)
2011/01/04 12:38:01
disallow copy and assign? also no empty line
gfeher
2011/01/04 23:37:09
Done.
| |
| 52 | |
| 53 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_LOADER_H_ | |
| OLD | NEW |