Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: ui/android/event_handler.cc

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: lazy creation Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698