Upstream version 11.39.244.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / browser / application_tizen.h
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 #ifndef XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_
6 #define XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_
7
8 #include <string>
9
10 #include "base/event_types.h"
11 #include "xwalk/application/browser/application.h"
12 #include "xwalk/application/common/tizen/cookie_manager.h"
13
14 #if defined(USE_OZONE)
15 #include "ui/events/platform/platform_event_observer.h"
16 #include "ui/events/platform/platform_event_types.h"
17 #endif
18
19 namespace xwalk {
20 namespace application {
21
22 class ApplicationTizen :  // NOLINT
23 #if defined(USE_OZONE)
24   public ui::PlatformEventObserver,
25 #endif
26   public Application {
27  public:
28   virtual ~ApplicationTizen();
29   void Hide();
30   void Show();
31   void Suspend();
32   void Resume();
33
34   void RemoveAllCookies();
35   void SetUserAgentString(const std::string& user_agent_string);
36
37  private:
38   friend class Application;
39   ApplicationTizen(scoped_refptr<ApplicationData> data,
40                    RuntimeContext* context);
41   virtual bool Launch(const LaunchParams& launch_params) OVERRIDE;
42
43   virtual base::FilePath GetSplashScreenPath() OVERRIDE;
44
45   // Runtime::Observer implementation.
46   virtual void OnRuntimeAdded(Runtime* runtime) OVERRIDE;
47   virtual void OnRuntimeRemoved(Runtime* runtime) OVERRIDE;
48
49 #if defined(USE_OZONE)
50   virtual void WillProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
51   virtual void DidProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
52 #endif
53
54 #if defined(OS_TIZEN_MOBILE)
55   NativeAppWindow* root_window_;
56 #endif
57   scoped_ptr<CookieManager> cookie_manager_;
58   bool is_suspended_;
59 };
60
61 inline ApplicationTizen* ToApplicationTizen(Application* app) {
62   return static_cast<ApplicationTizen*>(app);
63 }
64
65 }  // namespace application
66 }  // namespace xwalk
67
68 #endif  // XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_