Update To 11.40.268.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                    XWalkBrowserContext* context);
41   bool Launch(const LaunchParams& launch_params) override;
42
43   base::FilePath GetSplashScreenPath() override;
44
45   // Runtime::Observer implementation.
46   void OnNewRuntimeAdded(Runtime* runtime) override;
47   void OnRuntimeClosed(Runtime* runtime) override;
48
49 #if defined(USE_OZONE)
50   void WillProcessEvent(const ui::PlatformEvent& event) override;
51   void DidProcessEvent(const ui::PlatformEvent& event) override;
52 #endif
53   bool CanBeSuspended() const;
54
55 #if defined(OS_TIZEN_MOBILE)
56   NativeAppWindow* root_window_;
57 #endif
58   scoped_ptr<CookieManager> cookie_manager_;
59   bool is_suspended_;
60 };
61
62 inline ApplicationTizen* ToApplicationTizen(Application* app) {
63   return static_cast<ApplicationTizen*>(app);
64 }
65
66 }  // namespace application
67 }  // namespace xwalk
68
69 #endif  // XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_