| OLD | NEW | 
| (Empty) |  | 
 |   1 // Copyright (c) 2012 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_TEST_EXTENSION_SYSTEM_H_ | 
 |   6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 
 |   7 #pragma once | 
 |   8  | 
 |   9 #include "chrome/browser/extensions/extension_system.h" | 
 |  10  | 
 |  11 class CommandLine; | 
 |  12 class FilePath; | 
 |  13  | 
 |  14 // Test ExtensionSystem, for use with TestingProfile. | 
 |  15 class TestExtensionSystem : public ExtensionSystem { | 
 |  16  public: | 
 |  17   explicit TestExtensionSystem(Profile* profile); | 
 |  18   virtual ~TestExtensionSystem(); | 
 |  19  | 
 |  20   // ProfileKeyedService implementation. | 
 |  21   virtual void Shutdown() OVERRIDE; | 
 |  22  | 
 |  23   // Creates an ExtensionService initialized with the testing profile and | 
 |  24   // returns it. | 
 |  25   ExtensionService* CreateExtensionService(const CommandLine* command_line, | 
 |  26                                            const FilePath& install_directory, | 
 |  27                                            bool autoupdate_enabled); | 
 |  28  | 
 |  29   // Creates an ExtensionProcessManager. If not invoked, the | 
 |  30   // ExtensionProcessManager is NULL. | 
 |  31   void CreateExtensionProcessManager(); | 
 |  32  | 
 |  33   virtual void Init(bool extensions_enabled) OVERRIDE {} | 
 |  34   virtual ExtensionService* extension_service() OVERRIDE; | 
 |  35   void SetExtensionService(ExtensionService* service); | 
 |  36   virtual UserScriptMaster* user_script_master() OVERRIDE; | 
 |  37   virtual ExtensionDevToolsManager* devtools_manager() OVERRIDE; | 
 |  38   virtual ExtensionProcessManager* process_manager() OVERRIDE; | 
 |  39   virtual ExtensionInfoMap* info_map() OVERRIDE; | 
 |  40   virtual LazyBackgroundTaskQueue* lazy_background_task_queue() OVERRIDE; | 
 |  41   virtual ExtensionMessageService* message_service() OVERRIDE; | 
 |  42   virtual ExtensionEventRouter* event_router() OVERRIDE; | 
 |  43  | 
 |  44   // Factory method for tests to use with SetTestingProfile. | 
 |  45   static ProfileKeyedService* Build(Profile* profile); | 
 |  46  | 
 |  47  private: | 
 |  48   Profile* profile_; | 
 |  49  | 
 |  50   scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; | 
 |  51   // The Extension Preferences. Only created if CreateExtensionService is | 
 |  52   // invoked. | 
 |  53   scoped_ptr<ExtensionPrefs> extension_prefs_; | 
 |  54   scoped_ptr<ExtensionService> extension_service_; | 
 |  55   scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 
 |  56 }; | 
 |  57  | 
 |  58 #endif  // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 
| OLD | NEW |