OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "athena/extensions/public/extensions_delegate.h" | |
6 #include "base/macros.h" | |
7 #include "extensions/browser/install/extension_install_ui.h" | |
8 #include "extensions/common/extension_set.h" | |
9 | |
10 namespace athena { | |
11 namespace { | |
12 | |
13 class TestExtensionsDelegate : public ExtensionsDelegate { | |
14 public: | |
15 TestExtensionsDelegate() {} | |
16 | |
17 ~TestExtensionsDelegate() override {} | |
18 | |
19 private: | |
20 // ExtensionsDelegate: | |
21 content::BrowserContext* GetBrowserContext() const override { | |
22 return nullptr; | |
23 } | |
24 const extensions::ExtensionSet& GetInstalledExtensions() override { | |
25 return shell_extensions_; | |
26 } | |
27 bool LaunchApp(const std::string& app_id) override { return true; } | |
28 bool UnloadApp(const std::string& app_id) override { return false; } | |
29 | |
30 scoped_ptr<extensions::ExtensionInstallUI> CreateExtensionInstallUI() | |
31 override { | |
32 return scoped_ptr<extensions::ExtensionInstallUI>(); | |
33 } | |
34 | |
35 extensions::ExtensionSet shell_extensions_; | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(TestExtensionsDelegate); | |
38 }; | |
39 | |
40 } // namespace | |
41 | |
42 // static | |
43 void ExtensionsDelegate::CreateExtensionsDelegateForTest() { | |
44 new TestExtensionsDelegate(); | |
45 } | |
46 | |
47 } // namespace athena | |
OLD | NEW |