08ea60d723b05dd2a7f5dc6a53e85515f0fa9d56
[platform/framework/web/crosswalk.git] / src / xwalk / application / browser / application_tizen.h
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.
4 #ifndef XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_
5 #define XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_
6
7 #include "base/event_types.h"
8 #include "content/browser/screen_orientation/screen_orientation_provider.h"
9 #include "xwalk/application/browser/application.h"
10
11 #if defined(USE_OZONE)
12 #include "ui/events/platform/platform_event_observer.h"
13 #include "ui/events/platform/platform_event_types.h"
14 #endif
15
16 namespace xwalk {
17 namespace application {
18
19 class ApplicationTizen :  // NOLINT
20 #if defined(USE_OZONE)
21   public ui::PlatformEventObserver,
22 #endif
23   public Application, public content::ScreenOrientationProvider {
24  public:
25   virtual ~ApplicationTizen();
26   void Hide();
27
28  private:
29   // We enforce ApplicationService ownership.
30   friend class ApplicationService;
31   ApplicationTizen(scoped_refptr<ApplicationData> data,
32                    RuntimeContext* context,
33                    Application::Observer* observer);
34   virtual bool Launch(const LaunchParams& launch_params) OVERRIDE;
35
36 #if defined(USE_OZONE)
37   virtual void WillProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
38   virtual void DidProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
39 #endif
40
41   // content::ScreenOrientationProvider overrides:
42   virtual void LockOrientation(
43       blink::WebScreenOrientationLockType orientations) OVERRIDE;
44   virtual void UnlockOrientation() OVERRIDE;
45 };
46
47 inline ApplicationTizen* ToApplicationTizen(Application* app) {
48   return static_cast<ApplicationTizen*>(app);
49 }
50
51 }  // namespace application
52 }  // namespace xwalk
53
54 #endif  // XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_