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

Side by Side Diff: ui/platform_window/android/platform_window_android.h

Issue 1184913004: Revert of android: Introduce a ui::PlatformWindow implementation for android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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 2013 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 #ifndef UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_
6 #define UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_
7
8 #include "base/android/jni_weak_ref.h"
9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h"
11 #include "ui/events/event_constants.h"
12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/size.h"
14 #include "ui/gfx/sequential_id_generator.h"
15 #include "ui/platform_window/platform_window.h"
16
17 struct ANativeWindow;
18
19 namespace ui {
20
21 class PlatformWindowAndroid : public PlatformWindow {
22 public:
23 static bool Register(JNIEnv* env);
24
25 explicit PlatformWindowAndroid(PlatformWindowDelegate* delegate);
26 ~PlatformWindowAndroid() override;
27
28 void Destroy(JNIEnv* env, jobject obj);
29 void SurfaceCreated(JNIEnv* env,
30 jobject obj,
31 jobject jsurface,
32 float device_pixel_ratio);
33 void SurfaceDestroyed(JNIEnv* env, jobject obj);
34 void SurfaceSetSize(JNIEnv* env,
35 jobject obj,
36 jint width,
37 jint height,
38 jfloat density);
39 bool TouchEvent(JNIEnv* env,
40 jobject obj,
41 jlong time_ms,
42 jint masked_action,
43 jint pointer_id,
44 jfloat x,
45 jfloat y,
46 jfloat pressure,
47 jfloat touch_major,
48 jfloat touch_minor,
49 jfloat orientation,
50 jfloat h_wheel,
51 jfloat v_wheel);
52 bool KeyEvent(JNIEnv* env,
53 jobject obj,
54 bool pressed,
55 jint key_code,
56 jint unicode_character);
57 private:
58 void ReleaseWindow();
59
60 // Overridden from PlatformWindow:
61 void Show() override;
62 void Hide() override;
63 void Close() override;
64 void SetBounds(const gfx::Rect& bounds) override;
65 gfx::Rect GetBounds() override;
66 void SetCapture() override;
67 void ReleaseCapture() override;
68 void ToggleFullscreen() override;
69 void Maximize() override;
70 void Minimize() override;
71 void Restore() override;
72 void SetCursor(PlatformCursor cursor) override;
73 void MoveCursorTo(const gfx::Point& location) override;
74 void ConfineCursorToBounds(const gfx::Rect& bounds) override;
75
76 PlatformWindowDelegate* delegate_;
77
78 JavaObjectWeakGlobalRef java_platform_window_android_;
79 ANativeWindow* window_;
80 ui::SequentialIDGenerator id_generator_;
81
82 gfx::Size size_; // Origin is always (0,0)
83
84 base::WeakPtrFactory<PlatformWindowAndroid> weak_factory_;
85
86 DISALLOW_COPY_AND_ASSIGN(PlatformWindowAndroid);
87 };
88
89 } // namespace ui
90
91 #endif // UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698