| Index: chrome/browser/extensions/settings/settings_test_util.h
|
| diff --git a/chrome/browser/extensions/settings/settings_test_util.h b/chrome/browser/extensions/settings/settings_test_util.h
|
| index bad77a5f558e985b6ba45aff8224ee59f8d0110b..9129db9262c9bd955eb21c0689b71ca2f0f2b239 100644
|
| --- a/chrome/browser/extensions/settings/settings_test_util.h
|
| +++ b/chrome/browser/extensions/settings/settings_test_util.h
|
| @@ -1,3 +1,5 @@
|
| +//
|
| +//
|
| // Copyright (c) 2011 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.
|
| @@ -12,14 +14,16 @@
|
| #include "base/memory/ref_counted.h"
|
| #include "chrome/browser/extensions/extension_event_router.h"
|
| #include "chrome/browser/extensions/extension_service.h"
|
| +#include "chrome/browser/extensions/settings/settings_storage_factory.h"
|
| #include "chrome/browser/extensions/test_extension_service.h"
|
| #include "chrome/common/extensions/extension.h"
|
| #include "chrome/test/base/testing_profile.h"
|
|
|
| -class SettingsFrontend;
|
| -
|
| namespace extensions {
|
|
|
| +class SettingsFrontend;
|
| +class SettingsStorage;
|
| +
|
| // Utilities for extension settings API tests.
|
| namespace settings_test_util {
|
|
|
| @@ -63,6 +67,45 @@ class MockProfile : public TestingProfile {
|
| scoped_ptr<ExtensionEventRouter> event_router_;
|
| };
|
|
|
| +// A SettingsStorageFactory which delegates to other factories.
|
| +class DelegatingSettingsStorageFactory : public SettingsStorageFactory {
|
| + public:
|
| + // Creates with an initial delegate.
|
| + DelegatingSettingsStorageFactory(
|
| + // Ownership taken.
|
| + SettingsStorageFactory* delegate);
|
| +
|
| + virtual ~DelegatingSettingsStorageFactory();
|
| +
|
| + // Sets the delegate for Create calls. The existing delegate is deleted.
|
| + void Reset(
|
| + // Ownership taken.
|
| + SettingsStorageFactory* delegate);
|
| +
|
| + // SettingsStorageFactory implementation.
|
| + virtual SettingsStorage* Create(
|
| + const FilePath& base_path, const std::string& extension_id) OVERRIDE;
|
| +
|
| + private:
|
| + scoped_ptr<SettingsStorageFactory> delegate_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(DelegatingSettingsStorageFactory);
|
| +};
|
| +
|
| +// A SettingsStorageFactory which always returns NULL.
|
| +class NullSettingsStorageFactory : public SettingsStorageFactory {
|
| + public:
|
| + NullSettingsStorageFactory() {}
|
| + virtual ~NullSettingsStorageFactory() {}
|
| +
|
| + // SettingsStorageFactory implementation.
|
| + virtual SettingsStorage* Create(
|
| + const FilePath& base_path, const std::string& extension_id) OVERRIDE;
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(NullSettingsStorageFactory);
|
| +};
|
| +
|
| } // namespace settings_test_util
|
|
|
| } // namespace extensions
|
|
|