| Index: extensions/browser/test_extensions_browser_client.h
|
| diff --git a/apps/shell/browser/shell_extensions_browser_client.h b/extensions/browser/test_extensions_browser_client.h
|
| similarity index 65%
|
| copy from apps/shell/browser/shell_extensions_browser_client.h
|
| copy to extensions/browser/test_extensions_browser_client.h
|
| index 55b7f49fa224991aebfc3f97505a3afa30d6991e..2f4e47bc59487234413fba5b87e05030d5737537 100644
|
| --- a/apps/shell/browser/shell_extensions_browser_client.h
|
| +++ b/extensions/browser/test_extensions_browser_client.h
|
| @@ -1,26 +1,26 @@
|
| -// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Copyright 2014 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 APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_
|
| -#define APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_
|
| +#ifndef EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_
|
| +#define EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_
|
|
|
| #include "base/compiler_specific.h"
|
| #include "extensions/browser/extensions_browser_client.h"
|
|
|
| -class PrefService;
|
| -
|
| namespace extensions {
|
|
|
| -class ExtensionsAPIClient;
|
| -
|
| -// An ExtensionsBrowserClient that supports a single content::BrowserContent
|
| -// with no related incognito context.
|
| -class ShellExtensionsBrowserClient : public ExtensionsBrowserClient {
|
| +// A simplified ExtensionsBrowserClient for a single normal browser context and
|
| +// an optional incognito browser context associated with it. A test that uses
|
| +// this class should call ExtensionsBrowserClient::Set() with its instance.
|
| +class TestExtensionsBrowserClient : public ExtensionsBrowserClient {
|
| public:
|
| - // |context| is the single BrowserContext used for IsValidContext() below.
|
| - explicit ShellExtensionsBrowserClient(content::BrowserContext* context);
|
| - virtual ~ShellExtensionsBrowserClient();
|
| + // |context| is required and must not be an incognito context.
|
| + TestExtensionsBrowserClient(content::BrowserContext* main_context);
|
| + virtual ~TestExtensionsBrowserClient();
|
| +
|
| + // Associates an incognito context with |main_context_|.
|
| + void SetIncognitoContext(content::BrowserContext* incognito_context);
|
|
|
| // ExtensionsBrowserClient overrides:
|
| virtual bool IsShuttingDown() OVERRIDE;
|
| @@ -44,10 +44,10 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient {
|
| content::BrowserContext* context) const OVERRIDE;
|
| virtual PrefService* GetPrefServiceForContext(
|
| content::BrowserContext* context) OVERRIDE;
|
| - virtual bool DeferLoadingBackgroundHosts(content::BrowserContext* context)
|
| - const OVERRIDE;
|
| - virtual bool IsBackgroundPageAllowed(content::BrowserContext* context)
|
| - const OVERRIDE;
|
| + virtual bool DeferLoadingBackgroundHosts(
|
| + content::BrowserContext* context) const OVERRIDE;
|
| + virtual bool IsBackgroundPageAllowed(content::BrowserContext* context) const
|
| + OVERRIDE;
|
| virtual void OnExtensionHostCreated(content::WebContents* web_contents)
|
| OVERRIDE;
|
| virtual void OnRenderViewCreatedForBackgroundPage(ExtensionHost* host)
|
| @@ -64,18 +64,12 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient {
|
| ExtensionFunctionRegistry* registry) const OVERRIDE;
|
|
|
| private:
|
| - // The single BrowserContext for app_shell. Not owned.
|
| - content::BrowserContext* browser_context_;
|
| -
|
| - // Support for extension APIs.
|
| - scoped_ptr<ExtensionsAPIClient> api_client_;
|
| -
|
| - // The PrefService for |browser_context_|.
|
| - scoped_ptr<PrefService> prefs_;
|
| + content::BrowserContext* main_context_; // Not owned.
|
| + content::BrowserContext* incognito_context_; // Not owned, defaults to NULL.
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(ShellExtensionsBrowserClient);
|
| + DISALLOW_COPY_AND_ASSIGN(TestExtensionsBrowserClient);
|
| };
|
|
|
| } // namespace extensions
|
|
|
| -#endif // APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_
|
| +#endif // EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_
|
|
|