| Index: ui/android/event_handler.cc
|
| diff --git a/ui/android/event_handler.cc b/ui/android/event_handler.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..51ab14b001b7781336e7e2dbe731cca42be08100
|
| --- /dev/null
|
| +++ b/ui/android/event_handler.cc
|
| @@ -0,0 +1,38 @@
|
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ui/android/event_handler.h"
|
| +
|
| +#include "jni/EventHandler_jni.h"
|
| +#include "ui/android/view_android.h"
|
| +
|
| +namespace ui {
|
| +
|
| +EventHandler::EventHandler(ui::ViewAndroid* view) : view_(view) { }
|
| +
|
| +void EventHandler::OnPhysicalBackingSizeChanged(JNIEnv* env,
|
| + const base::android::JavaParamRef<jobject>& obj,
|
| + int width,
|
| + int height) {
|
| + if (physical_width_pix_ == width && physical_height_pix_ == height)
|
| + return;
|
| + physical_width_pix_ = width;
|
| + physical_height_pix_ = height;
|
| +
|
| + view_->OnPhysicalBackingSizeChanged(width, height);
|
| +}
|
| +
|
| +int EventHandler::GetPhysicalBackingSizeWidthPix() {
|
| + return physical_width_pix_;
|
| +}
|
| +
|
| +int EventHandler::GetPhysicalBackingSizeHeightPix() {
|
| + return physical_height_pix_;
|
| +}
|
| +
|
| +bool RegisterEventHandler(JNIEnv* env) {
|
| + return RegisterNativesImpl(env);
|
| +}
|
| +
|
| +} // namespace content
|
|
|