| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_ | 5 #ifndef EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_ |
| 6 #define EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_ | 6 #define EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "extensions/browser/extensions_browser_client.h" | 9 #include "extensions/browser/extensions_browser_client.h" |
| 10 | 10 |
| 11 namespace extensions { | 11 namespace extensions { |
| 12 | 12 |
| 13 // A simplified ExtensionsBrowserClient for a single normal browser context and | 13 // A simplified ExtensionsBrowserClient for a single normal browser context and |
| 14 // an optional incognito browser context associated with it. A test that uses | 14 // an optional incognito browser context associated with it. A test that uses |
| 15 // this class should call ExtensionsBrowserClient::Set() with its instance. | 15 // this class should call ExtensionsBrowserClient::Set() with its instance. |
| 16 class TestExtensionsBrowserClient : public ExtensionsBrowserClient { | 16 class TestExtensionsBrowserClient : public ExtensionsBrowserClient { |
| 17 public: | 17 public: |
| 18 // |context| is required and must not be an incognito context. | 18 // |context| is required and must not be an incognito context. |
| 19 TestExtensionsBrowserClient(content::BrowserContext* main_context); | 19 TestExtensionsBrowserClient(content::BrowserContext* main_context); |
| 20 virtual ~TestExtensionsBrowserClient(); | 20 virtual ~TestExtensionsBrowserClient(); |
| 21 | 21 |
| 22 // Associates an incognito context with |main_context_|. | 22 // Associates an incognito context with |main_context_|. |
| 23 void SetIncognitoContext(content::BrowserContext* incognito_context); | 23 void SetIncognitoContext(content::BrowserContext* incognito_context); |
| 24 | 24 |
| 25 // ExtensionsBrowserClient overrides: | 25 // ExtensionsBrowserClient overrides: |
| 26 virtual bool IsShuttingDown() OVERRIDE; | 26 virtual bool IsShuttingDown() OVERRIDE; |
| 27 virtual bool AreExtensionsDisabled(const CommandLine& command_line, | 27 virtual bool AreExtensionsDisabled(const base::CommandLine& command_line, |
| 28 content::BrowserContext* context) OVERRIDE; | 28 content::BrowserContext* context) OVERRIDE; |
| 29 virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; | 29 virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; |
| 30 virtual bool IsSameContext(content::BrowserContext* first, | 30 virtual bool IsSameContext(content::BrowserContext* first, |
| 31 content::BrowserContext* second) OVERRIDE; | 31 content::BrowserContext* second) OVERRIDE; |
| 32 virtual bool HasOffTheRecordContext(content::BrowserContext* context) | 32 virtual bool HasOffTheRecordContext(content::BrowserContext* context) |
| 33 OVERRIDE; | 33 OVERRIDE; |
| 34 virtual content::BrowserContext* GetOffTheRecordContext( | 34 virtual content::BrowserContext* GetOffTheRecordContext( |
| 35 content::BrowserContext* context) OVERRIDE; | 35 content::BrowserContext* context) OVERRIDE; |
| 36 virtual content::BrowserContext* GetOriginalContext( | 36 virtual content::BrowserContext* GetOriginalContext( |
| 37 content::BrowserContext* context) OVERRIDE; | 37 content::BrowserContext* context) OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 67 private: | 67 private: |
| 68 content::BrowserContext* main_context_; // Not owned. | 68 content::BrowserContext* main_context_; // Not owned. |
| 69 content::BrowserContext* incognito_context_; // Not owned, defaults to NULL. | 69 content::BrowserContext* incognito_context_; // Not owned, defaults to NULL. |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(TestExtensionsBrowserClient); | 71 DISALLOW_COPY_AND_ASSIGN(TestExtensionsBrowserClient); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace extensions | 74 } // namespace extensions |
| 75 | 75 |
| 76 #endif // EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_ | 76 #endif // EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_ |
| OLD | NEW |