1 // Copyright (c) 2013 Intel Corporation. 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.
5 #ifndef XWALK_RUNTIME_BROWSER_APPLICATION_COMPONENT_H_
6 #define XWALK_RUNTIME_BROWSER_APPLICATION_COMPONENT_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "xwalk/runtime/browser/xwalk_component.h"
15 namespace application {
16 class ApplicationSystem;
19 // Sets up the ApplicationSystem features of Crosswalk, and implements
20 // the necessary interface to register the extensions for new
21 // Applications being launched.
22 class ApplicationComponent : public XWalkComponent {
24 explicit ApplicationComponent(RuntimeContext* runtime_context);
25 virtual ~ApplicationComponent();
27 // Used by Android since extensions for Application are not supported there.
28 void DisableExtensions() { extensions_enabled_ = false; }
30 application::ApplicationSystem* app_system() { return app_system_.get(); }
33 // XWalkComponent implementation.
34 virtual void CreateUIThreadExtensions(
35 content::RenderProcessHost* host,
36 extensions::XWalkExtensionVector* extensions) OVERRIDE;
37 virtual void CreateExtensionThreadExtensions(
38 content::RenderProcessHost* host,
39 extensions::XWalkExtensionVector* extensions) OVERRIDE;
41 scoped_ptr<application::ApplicationSystem> app_system_;
42 bool extensions_enabled_;
47 #endif // XWALK_RUNTIME_BROWSER_APPLICATION_COMPONENT_H_