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