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

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

Issue 1455793005: Adding a way to associate Android Activities with PlatformWindowAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@auraclank_upstream_native_widget
Patch Set: Making the new property "owned" property. Created 5 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_ 5 #ifndef UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_
6 #define UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_ 6 #define UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_
7 7
8 #include "base/android/jni_weak_ref.h" 8 #include "base/android/jni_weak_ref.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "ui/events/event_constants.h" 11 #include "ui/events/event_constants.h"
12 #include "ui/gfx/geometry/rect.h" 12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/size.h" 13 #include "ui/gfx/geometry/size.h"
14 #include "ui/gfx/sequential_id_generator.h" 14 #include "ui/gfx/sequential_id_generator.h"
15 #include "ui/platform_window/android/android_window_export.h" 15 #include "ui/platform_window/android/android_window_export.h"
16 #include "ui/platform_window/android/platform_ime_controller_android.h" 16 #include "ui/platform_window/android/platform_ime_controller_android.h"
17 #include "ui/platform_window/platform_window.h" 17 #include "ui/platform_window/platform_window.h"
18 18
19 struct ANativeWindow; 19 struct ANativeWindow;
20 20
21 namespace ui { 21 namespace ui {
22 22
23 class ANDROID_WINDOW_EXPORT PlatformWindowAndroid : public PlatformWindow { 23 class ANDROID_WINDOW_EXPORT PlatformWindowAndroid : public PlatformWindow {
24 public: 24 public:
25 static bool Register(JNIEnv* env); 25 static bool Register(JNIEnv* env);
26 static PlatformWindowAndroid* From(PlatformWindow* platform_window);
26 27
27 explicit PlatformWindowAndroid(PlatformWindowDelegate* delegate); 28 explicit PlatformWindowAndroid(PlatformWindowDelegate* delegate);
28 ~PlatformWindowAndroid() override; 29 ~PlatformWindowAndroid() override;
29 30
31 void AttachToActivity(JNIEnv* env,
32 const base::android::JavaRef<jobject>& activity);
33 bool IsAttachedToActivity() const;
30 void Destroy(JNIEnv* env, jobject obj); 34 void Destroy(JNIEnv* env, jobject obj);
31 void SurfaceCreated(JNIEnv* env, 35 void SurfaceCreated(JNIEnv* env,
32 jobject obj, 36 jobject obj,
33 jobject jsurface, 37 jobject jsurface,
34 float device_pixel_ratio); 38 float device_pixel_ratio);
35 void SurfaceDestroyed(JNIEnv* env, jobject obj); 39 void SurfaceDestroyed(JNIEnv* env, jobject obj);
36 void SurfaceSetSize(JNIEnv* env, 40 void SurfaceSetSize(JNIEnv* env,
37 jobject obj, 41 jobject obj,
38 jint width, 42 jint width,
39 jint height, 43 jint height,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 PlatformImeControllerAndroid platform_ime_controller_; 93 PlatformImeControllerAndroid platform_ime_controller_;
90 94
91 base::WeakPtrFactory<PlatformWindowAndroid> weak_factory_; 95 base::WeakPtrFactory<PlatformWindowAndroid> weak_factory_;
92 96
93 DISALLOW_COPY_AND_ASSIGN(PlatformWindowAndroid); 97 DISALLOW_COPY_AND_ASSIGN(PlatformWindowAndroid);
94 }; 98 };
95 99
96 } // namespace ui 100 } // namespace ui
97 101
98 #endif // UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_ 102 #endif // UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_
OLDNEW
« no previous file with comments | « ui/aura/window_tree_host_platform.cc ('k') | ui/platform_window/android/platform_window_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698