Chromium Code Reviews| Index: chrome/browser/extensions/external_pref_extension_loader.h |
| diff --git a/chrome/browser/extensions/external_pref_extension_loader.h b/chrome/browser/extensions/external_pref_extension_loader.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f16735b89c986bd514438df22b66bad14ede776e |
| --- /dev/null |
| +++ b/chrome/browser/extensions/external_pref_extension_loader.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_LOADER_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_LOADER_H_ |
| +#pragma once |
| + |
| +#include "chrome/browser/extensions/external_extension_loader.h" |
| + |
| +#include <string> |
| + |
| +#include "base/scoped_ptr.h" |
| +#include "base/values.h" |
| + |
| +// A specialization of the ExternalExtensionLoader that uses a json file to |
| +// look up which external extensions are registered. |
| +// Instances of this class are expected to be created and destroyed on the UI |
| +// thread and they are expecting public method calls from the UI thread. |
| +class ExternalPrefExtensionLoader : public ExternalExtensionLoader { |
| + public: |
| + explicit ExternalPrefExtensionLoader(); |
|
jochen (gone - plz use gerrit)
2011/01/04 12:38:01
no explicit
gfeher
2011/01/04 23:37:09
Done.
|
| + |
| + protected: |
| + virtual void Load(); |
| + |
| + private: |
| + friend class base::RefCountedThreadSafe<ExternalExtensionLoader>; |
| + |
| + virtual ~ExternalPrefExtensionLoader() {} |
| + |
| + void LoadOnFileThread(); |
| +}; |
|
jochen (gone - plz use gerrit)
2011/01/04 12:38:01
disallow copy and assign?
gfeher
2011/01/04 23:37:09
Done.
|
| + |
| +// A simplified version of ExternalPrefExtensionLoader that loads the dictionary |
| +// from json data specified in a string. |
| +class ExternalTestingExtensionLoader : public ExternalExtensionLoader { |
| + public: |
| + explicit ExternalTestingExtensionLoader(const std::string& json_data); |
| + |
| + protected: |
| + virtual void Load(); |
| + |
| + private: |
| + friend class base::RefCountedThreadSafe<ExternalExtensionLoader>; |
| + |
| + virtual ~ExternalTestingExtensionLoader() {} |
| + |
| + scoped_ptr<DictionaryValue> testing_prefs_; |
| + |
| +}; |
|
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.
|
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_LOADER_H_ |