OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 class CrxInstaller; | 14 class CrxInstaller; |
15 class Extension; | 15 class Extension; |
16 } | 16 } |
17 | 17 |
18 // Implemention of ExtensionServiceInterface with default | 18 // Implemention of ExtensionServiceInterface with default |
19 // implementations for methods that add failures. You should subclass | 19 // implementations for methods that add failures. You should subclass |
20 // this and override the methods you care about. | 20 // this and override the methods you care about. |
21 class TestExtensionService : public ExtensionServiceInterface { | 21 class TestExtensionService : public ExtensionServiceInterface { |
22 public: | 22 public: |
23 virtual ~TestExtensionService(); | 23 ~TestExtensionService() override; |
24 | 24 |
25 // ExtensionServiceInterface implementation. | 25 // ExtensionServiceInterface implementation. |
26 virtual const extensions::ExtensionSet* extensions() const override; | 26 const extensions::ExtensionSet* extensions() const override; |
27 virtual extensions::PendingExtensionManager* | 27 extensions::PendingExtensionManager* pending_extension_manager() override; |
28 pending_extension_manager() override; | |
29 | 28 |
30 virtual bool UpdateExtension( | 29 bool UpdateExtension(const std::string& id, |
| 30 const base::FilePath& path, |
| 31 bool file_ownership_passed, |
| 32 extensions::CrxInstaller** out_crx_installer) override; |
| 33 const extensions::Extension* GetExtensionById( |
31 const std::string& id, | 34 const std::string& id, |
32 const base::FilePath& path, | 35 bool include_disabled) const override; |
33 bool file_ownership_passed, | 36 const extensions::Extension* GetInstalledExtension( |
34 extensions::CrxInstaller** out_crx_installer) override; | |
35 virtual const extensions::Extension* GetExtensionById( | |
36 const std::string& id, bool include_disabled) const override; | |
37 virtual const extensions::Extension* GetInstalledExtension( | |
38 const std::string& id) const override; | 37 const std::string& id) const override; |
39 virtual const extensions::Extension* GetPendingExtensionUpdate( | 38 const extensions::Extension* GetPendingExtensionUpdate( |
40 const std::string& extension_id) const override; | 39 const std::string& extension_id) const override; |
41 virtual void FinishDelayedInstallation( | 40 void FinishDelayedInstallation(const std::string& extension_id) override; |
42 const std::string& extension_id) override; | 41 bool IsExtensionEnabled(const std::string& extension_id) const override; |
43 virtual bool IsExtensionEnabled( | |
44 const std::string& extension_id) const override; | |
45 | 42 |
46 virtual void CheckManagementPolicy() override; | 43 void CheckManagementPolicy() override; |
47 virtual void CheckForUpdatesSoon() override; | 44 void CheckForUpdatesSoon() override; |
48 | 45 |
49 virtual bool is_ready() override; | 46 bool is_ready() override; |
50 | 47 |
51 virtual base::SequencedTaskRunner* GetFileTaskRunner() override; | 48 base::SequencedTaskRunner* GetFileTaskRunner() override; |
52 | 49 |
53 virtual void AddExtension(const extensions::Extension* extension) override; | 50 void AddExtension(const extensions::Extension* extension) override; |
54 virtual void AddComponentExtension( | 51 void AddComponentExtension(const extensions::Extension* extension) override; |
55 const extensions::Extension* extension) override; | |
56 | 52 |
57 virtual void UnloadExtension( | 53 void UnloadExtension( |
58 const std::string& extension_id, | 54 const std::string& extension_id, |
59 extensions::UnloadedExtensionInfo::Reason reason) override; | 55 extensions::UnloadedExtensionInfo::Reason reason) override; |
60 virtual void RemoveComponentExtension(const std::string & extension_id) | 56 void RemoveComponentExtension(const std::string& extension_id) override; |
61 override; | |
62 }; | 57 }; |
63 | 58 |
64 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_ | 59 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_ |
OLD | NEW |