| 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 | 6 |
| 7 #include "athena/extensions/chrome/athena_chrome_app_window_client.h" | 7 #include "athena/extensions/chrome/athena_chrome_app_window_client.h" |
| 8 #include "athena/extensions/chrome/athena_extension_install_ui.h" | 8 #include "athena/extensions/chrome/athena_extension_install_ui.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 class ChromeExtensionsDelegate : public ExtensionsDelegate { | 26 class ChromeExtensionsDelegate : public ExtensionsDelegate { |
| 27 public: | 27 public: |
| 28 explicit ChromeExtensionsDelegate(content::BrowserContext* context) | 28 explicit ChromeExtensionsDelegate(content::BrowserContext* context) |
| 29 : extension_service_( | 29 : extension_service_( |
| 30 extensions::ExtensionSystem::Get(context)->extension_service()) { | 30 extensions::ExtensionSystem::Get(context)->extension_service()) { |
| 31 extensions::AppWindowClient::Set(&app_window_client_); | 31 extensions::AppWindowClient::Set(&app_window_client_); |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual ~ChromeExtensionsDelegate() { | 34 virtual ~ChromeExtensionsDelegate() { |
| 35 extensions::AppWindowClient::Set(NULL); | 35 extensions::AppWindowClient::Set(nullptr); |
| 36 } | 36 } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // ExtensionsDelegate: | 39 // ExtensionsDelegate: |
| 40 virtual content::BrowserContext* GetBrowserContext() const override { | 40 virtual content::BrowserContext* GetBrowserContext() const override { |
| 41 return extension_service_->GetBrowserContext(); | 41 return extension_service_->GetBrowserContext(); |
| 42 } | 42 } |
| 43 virtual const extensions::ExtensionSet& GetInstalledExtensions() override { | 43 virtual const extensions::ExtensionSet& GetInstalledExtensions() override { |
| 44 return *extension_service_->extensions(); | 44 return *extension_service_->extensions(); |
| 45 } | 45 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 // static | 106 // static |
| 107 void ExtensionsDelegate::CreateExtensionsDelegate( | 107 void ExtensionsDelegate::CreateExtensionsDelegate( |
| 108 content::BrowserContext* context) { | 108 content::BrowserContext* context) { |
| 109 new ChromeExtensionsDelegate(context); | 109 new ChromeExtensionsDelegate(context); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace athena | 112 } // namespace athena |
| OLD | NEW |