| 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/shell/athena_shell_app_window_client.h" | 7 #include "athena/extensions/shell/athena_shell_app_window_client.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "extensions/common/extension_set.h" | 9 #include "extensions/common/extension_set.h" |
| 10 #include "extensions/shell/browser/shell_extension_system.h" | 10 #include "extensions/shell/browser/shell_extension_system.h" |
| 11 | 11 |
| 12 namespace athena { | 12 namespace athena { |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 class ShellExtensionsDelegate : public ExtensionsDelegate { | 15 class ShellExtensionsDelegate : public ExtensionsDelegate { |
| 16 public: | 16 public: |
| 17 explicit ShellExtensionsDelegate(content::BrowserContext* context) | 17 explicit ShellExtensionsDelegate(content::BrowserContext* context) |
| 18 : context_(context), | 18 : context_(context), |
| 19 extension_system_(static_cast<extensions::ShellExtensionSystem*>( | 19 extension_system_(static_cast<extensions::ShellExtensionSystem*>( |
| 20 extensions::ExtensionSystem::Get(context))), | 20 extensions::ExtensionSystem::Get(context))) { |
| 21 app_window_client_(context) { | |
| 22 extensions::AppWindowClient::Set(&app_window_client_); | 21 extensions::AppWindowClient::Set(&app_window_client_); |
| 23 } | 22 } |
| 24 | 23 |
| 25 virtual ~ShellExtensionsDelegate() { extensions::AppWindowClient::Set(NULL); } | 24 virtual ~ShellExtensionsDelegate() { extensions::AppWindowClient::Set(NULL); } |
| 26 | 25 |
| 27 private: | 26 private: |
| 28 // ExtensionsDelegate: | 27 // ExtensionsDelegate: |
| 29 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE { | 28 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE { |
| 30 return context_; | 29 return context_; |
| 31 } | 30 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 53 | 52 |
| 54 } // namespace | 53 } // namespace |
| 55 | 54 |
| 56 // static | 55 // static |
| 57 void ExtensionsDelegate::CreateExtensionsDelegateForShell( | 56 void ExtensionsDelegate::CreateExtensionsDelegateForShell( |
| 58 content::BrowserContext* context) { | 57 content::BrowserContext* context) { |
| 59 new ShellExtensionsDelegate(context); | 58 new ShellExtensionsDelegate(context); |
| 60 } | 59 } |
| 61 | 60 |
| 62 } // namespace athena | 61 } // namespace athena |
| OLD | NEW |