Upstream version 11.39.256.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / browser / application_tizen.h
index a1d424f..98e5b41 100644 (file)
@@ -1,41 +1,62 @@
 // Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 #ifndef XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_
 #define XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_
 
+#include <string>
+
+#include "base/event_types.h"
 #include "xwalk/application/browser/application.h"
+#include "xwalk/application/common/tizen/cookie_manager.h"
 
 #if defined(USE_OZONE)
-#include "base/message_loop/message_pump_observer.h"
+#include "ui/events/platform/platform_event_observer.h"
+#include "ui/events/platform/platform_event_types.h"
 #endif
 
 namespace xwalk {
 namespace application {
 
-class ApplicationTizen : //  NOLINT
+class ApplicationTizen :  // NOLINT
 #if defined(USE_OZONE)
-  public base::MessagePumpObserver,
+  public ui::PlatformEventObserver,
 #endif
   public Application {
  public:
   virtual ~ApplicationTizen();
   void Hide();
+  void Show();
+  void Suspend();
+  void Resume();
+
+  void RemoveAllCookies();
+  void SetUserAgentString(const std::string& user_agent_string);
 
  private:
-  // We enforce ApplicationService ownership.
-  friend class ApplicationService;
+  friend class Application;
   ApplicationTizen(scoped_refptr<ApplicationData> data,
-                   RuntimeContext* context,
-                   Application::Observer* observer);
+                   XWalkBrowserContext* context);
+  virtual bool Launch(const LaunchParams& launch_params) OVERRIDE;
+
+  virtual base::FilePath GetSplashScreenPath() OVERRIDE;
 
-  virtual void InitSecurityPolicy() OVERRIDE;
+  // Runtime::Observer implementation.
+  virtual void OnNewRuntimeAdded(Runtime* runtime) OVERRIDE;
+  virtual void OnRuntimeClosed(Runtime* runtime) OVERRIDE;
 
 #if defined(USE_OZONE)
-  virtual base::EventStatus WillProcessEvent(
-      const base::NativeEvent& event) OVERRIDE;
-  virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE;
+  virtual void WillProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
+  virtual void DidProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
+#endif
+  bool CanBeSuspended() const;
+
+#if defined(OS_TIZEN_MOBILE)
+  NativeAppWindow* root_window_;
 #endif
+  scoped_ptr<CookieManager> cookie_manager_;
+  bool is_suspended_;
 };
 
 inline ApplicationTizen* ToApplicationTizen(Application* app) {