Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / mojo / shell / context.h
index 3c33a75..c191e8c 100644 (file)
@@ -8,7 +8,6 @@
 #include <string>
 
 #include "mojo/application_manager/application_manager.h"
-#include "mojo/shell/keep_alive.h"
 #include "mojo/shell/mojo_url_resolver.h"
 #include "mojo/shell/task_runners.h"
 
@@ -25,16 +24,23 @@ namespace shell {
 class DynamicApplicationLoader;
 
 // The "global" context for the shell's main process.
-class Context {
+class Context : ApplicationManager::Delegate {
  public:
   Context();
-  ~Context();
+  virtual ~Context();
 
   void Init();
 
+  // ApplicationManager::Delegate override.
+  virtual void OnApplicationError(const GURL& gurl) OVERRIDE;
+
+  void Run(const GURL& url);
+  ScopedMessagePipeHandle ConnectToServiceByName(
+      const GURL& application_url,
+      const std::string& service_name);
+
   TaskRunners* task_runners() { return task_runners_.get(); }
   ApplicationManager* application_manager() { return &application_manager_; }
-  KeepAliveCounter* keep_alive_counter() { return &keep_alive_counter_; }
   MojoURLResolver* mojo_url_resolver() { return &mojo_url_resolver_; }
 
 #if defined(OS_ANDROID)
@@ -45,6 +51,7 @@ class Context {
  private:
   class NativeViewportApplicationLoader;
 
+  std::set<GURL> app_urls_;
   scoped_ptr<TaskRunners> task_runners_;
   ApplicationManager application_manager_;
   MojoURLResolver mojo_url_resolver_;
@@ -53,8 +60,6 @@ class Context {
   base::MessageLoop* ui_loop_;
 #endif  // defined(OS_ANDROID)
 
-  KeepAliveCounter keep_alive_counter_;
-
   DISALLOW_COPY_AND_ASSIGN(Context);
 };