#include "xwalk/runtime/browser/ui/native_app_window_tizen.h"
#include "xwalk/runtime/common/xwalk_common_messages.h"
-#if defined(USE_OZONE)
#include "content/public/browser/render_view_host.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
+#include "ui/events/event_utils.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
#include "ui/events/platform/platform_event_source.h"
-#endif
#include "xwalk/application/common/application_manifest_constants.h"
#include "xwalk/application/common/manifest_handlers/tizen_setting_handler.h"
root_window_(NULL),
#endif
is_suspended_(false) {
-#if defined(USE_OZONE)
ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this);
-#endif
cookie_manager_ = scoped_ptr<CookieManager>(
new CookieManager(id(), browser_context_));
}
ApplicationTizen::~ApplicationTizen() {
-#if defined(USE_OZONE)
ui::PlatformEventSource::GetInstance()->RemovePlatformEventObserver(this);
-#endif
}
void ApplicationTizen::Hide() {
is_suspended_ = false;
}
-#if defined(USE_OZONE)
void ApplicationTizen::WillProcessEvent(const ui::PlatformEvent& event) {}
void ApplicationTizen::DidProcessEvent(
const ui::PlatformEvent& event) {
- ui::Event* ui_event = static_cast<ui::Event*>(event);
- if (!ui_event->IsKeyEvent() || ui_event->type() != ui::ET_KEY_PRESSED)
+
+ scoped_ptr<ui::Event> ui_event(ui::EventFromNative(event));
+ if (!ui_event ||
+ !ui_event->IsKeyEvent() || ui_event->type() != ui::ET_KEY_PRESSED)
return;
- ui::KeyEvent* key_event = static_cast<ui::KeyEvent*>(ui_event);
+ ui::KeyEvent* key_event = static_cast<ui::KeyEvent*>(ui_event.get());
// FIXME: Most Wayland devices don't have similar hardware button for 'back'
// and 'memu' as Tizen Mobile, even that hardare buttons could be different
(*it)->web_contents()->GetRoutingID(), key_event->key_code()));
}
}
-#endif
void ApplicationTizen::RemoveAllCookies() {
cookie_manager_->RemoveAllCookies();
#include "xwalk/application/browser/application.h"
#include "xwalk/application/common/tizen/cookie_manager.h"
-#if defined(USE_OZONE)
#include "ui/events/platform/platform_event_observer.h"
#include "ui/events/platform/platform_event_types.h"
-#endif
namespace xwalk {
namespace application {
class ApplicationTizen : // NOLINT
-#if defined(USE_OZONE)
public ui::PlatformEventObserver,
-#endif
public Application {
public:
virtual ~ApplicationTizen();
void OnNewRuntimeAdded(Runtime* runtime) override;
void OnRuntimeClosed(Runtime* runtime) override;
-#if defined(USE_OZONE)
void WillProcessEvent(const ui::PlatformEvent& event) override;
void DidProcessEvent(const ui::PlatformEvent& event) override;
-#endif
+
bool CanBeSuspended() const;
#if defined(OS_TIZEN_MOBILE)