OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. 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 |
| 5 #include "ui/android/event_handler.h" |
| 6 |
| 7 #include "jni/EventHandler_jni.h" |
| 8 #include "ui/android/view_android.h" |
| 9 |
| 10 namespace ui { |
| 11 |
| 12 EventHandler::EventHandler(ui::ViewAndroid* view) : view_(view) { } |
| 13 |
| 14 void EventHandler::OnPhysicalBackingSizeChanged(JNIEnv* env, |
| 15 const base::android::JavaParamRef<jobject>& obj, |
| 16 int width, |
| 17 int height) { |
| 18 if (physical_width_pix_ == width && physical_height_pix_ == height) |
| 19 return; |
| 20 physical_width_pix_ = width; |
| 21 physical_height_pix_ = height; |
| 22 |
| 23 view_->OnPhysicalBackingSizeChanged(width, height); |
| 24 } |
| 25 |
| 26 int EventHandler::GetPhysicalBackingSizeWidthPix() { |
| 27 return physical_width_pix_; |
| 28 } |
| 29 |
| 30 int EventHandler::GetPhysicalBackingSizeHeightPix() { |
| 31 return physical_height_pix_; |
| 32 } |
| 33 |
| 34 bool RegisterEventHandler(JNIEnv* env) { |
| 35 return RegisterNativesImpl(env); |
| 36 } |
| 37 |
| 38 } // namespace content |
OLD | NEW |