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

Side by Side Diff: ui/android/window_android.h

Issue 2136373002: Make WindowAndroid a ViewAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@view3
Patch Set: Make WindowAndroid a ViewAndroid Created 4 years, 5 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
« no previous file with comments | « ui/android/view_android.cc ('k') | ui/android/window_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ANDROID_WINDOW_ANDROID_H_ 5 #ifndef UI_ANDROID_WINDOW_ANDROID_H_
6 #define UI_ANDROID_WINDOW_ANDROID_H_ 6 #define UI_ANDROID_WINDOW_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/android/jni_weak_ref.h" 12 #include "base/android/jni_weak_ref.h"
13 #include "base/android/scoped_java_ref.h" 13 #include "base/android/scoped_java_ref.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "ui/android/ui_android_export.h" 17 #include "ui/android/ui_android_export.h"
18 #include "ui/android/view_android.h"
18 #include "ui/gfx/geometry/vector2d_f.h" 19 #include "ui/gfx/geometry/vector2d_f.h"
19 20
20 namespace ui { 21 namespace ui {
21 22
22 class WindowAndroidCompositor; 23 class WindowAndroidCompositor;
23 class WindowAndroidObserver; 24 class WindowAndroidObserver;
24 25
25 // Android implementation of the activity window. 26 // Android implementation of the activity window.
26 class UI_ANDROID_EXPORT WindowAndroid { 27 // WindowAndroid is also the root of a ViewAndroid tree.
28 class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid {
27 public: 29 public:
28 WindowAndroid(JNIEnv* env, jobject obj); 30 WindowAndroid(JNIEnv* env, jobject obj);
29 31
30 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 32 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
31 33
32 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); 34 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
33 35
34 static bool RegisterWindowAndroid(JNIEnv* env); 36 static bool RegisterWindowAndroid(JNIEnv* env);
35 37
36 // The content offset is used to translate snapshots to the correct part of 38 // The content offset is used to translate snapshots to the correct part of
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // Return whether the specified Android permission can be requested by Chrome. 76 // Return whether the specified Android permission can be requested by Chrome.
75 bool CanRequestPermission(const std::string& permission); 77 bool CanRequestPermission(const std::string& permission);
76 78
77 static WindowAndroid* createForTesting(); 79 static WindowAndroid* createForTesting();
78 void StartDragAndDrop( 80 void StartDragAndDrop(
79 const base::android::JavaRef<jobject>& jview_android_delegate, 81 const base::android::JavaRef<jobject>& jview_android_delegate,
80 const base::android::JavaRef<jstring>& jtext, 82 const base::android::JavaRef<jstring>& jtext,
81 const base::android::JavaRef<jobject>& jimage); 83 const base::android::JavaRef<jobject>& jimage);
82 84
83 private: 85 private:
84 ~WindowAndroid(); 86 ~WindowAndroid() override;
87
88 // ViewAndroid overrides.
89 WindowAndroid* GetWindowAndroid() const override;
85 90
86 base::android::ScopedJavaGlobalRef<jobject> java_window_; 91 base::android::ScopedJavaGlobalRef<jobject> java_window_;
87 gfx::Vector2dF content_offset_; 92 gfx::Vector2dF content_offset_;
88 WindowAndroidCompositor* compositor_; 93 WindowAndroidCompositor* compositor_;
89 94
90 base::ObserverList<WindowAndroidObserver> observer_list_; 95 base::ObserverList<WindowAndroidObserver> observer_list_;
91 96
92 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); 97 DISALLOW_COPY_AND_ASSIGN(WindowAndroid);
93 }; 98 };
94 99
95 } // namespace ui 100 } // namespace ui
96 101
97 #endif // UI_ANDROID_WINDOW_ANDROID_H_ 102 #endif // UI_ANDROID_WINDOW_ANDROID_H_
OLDNEW
« no previous file with comments | « ui/android/view_android.cc ('k') | ui/android/window_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698