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

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

Issue 929903002: Remove cc dependency from ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes in ui/PRESUBMIT.py Created 5 years, 10 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/base/android/view_android.cc ('k') | ui/base/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
(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_BASE_ANDROID_WINDOW_ANDROID_H_
6 #define UI_BASE_ANDROID_WINDOW_ANDROID_H_
7
8 #include <jni.h>
9 #include <vector>
10
11 #include "base/android/jni_weak_ref.h"
12 #include "base/android/scoped_java_ref.h"
13 #include "base/observer_list.h"
14 #include "base/time/time.h"
15 #include "ui/base/ui_base_export.h"
16 #include "ui/gfx/geometry/vector2d_f.h"
17
18 namespace ui {
19
20 class WindowAndroidCompositor;
21 class WindowAndroidObserver;
22
23 // Android implementation of the activity window.
24 class UI_BASE_EXPORT WindowAndroid {
25 public:
26 WindowAndroid(JNIEnv* env, jobject obj);
27
28 void Destroy(JNIEnv* env, jobject obj);
29
30 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
31
32 static bool RegisterWindowAndroid(JNIEnv* env);
33
34 // The content offset is used to translate snapshots to the correct part of
35 // the window.
36 void set_content_offset(const gfx::Vector2dF& content_offset) {
37 content_offset_ = content_offset;
38 }
39
40 gfx::Vector2dF content_offset() const {
41 return content_offset_;
42 }
43
44 // Compositor callback relay.
45 void OnCompositingDidCommit();
46
47 void AttachCompositor(WindowAndroidCompositor* compositor);
48 void DetachCompositor();
49
50 void AddObserver(WindowAndroidObserver* observer);
51 void RemoveObserver(WindowAndroidObserver* observer);
52
53 WindowAndroidCompositor* GetCompositor() { return compositor_; }
54
55 void RequestVSyncUpdate();
56 void SetNeedsAnimate();
57 void OnVSync(JNIEnv* env,
58 jobject obj,
59 jlong time_micros,
60 jlong period_micros);
61 void Animate(base::TimeTicks begin_frame_time);
62
63 private:
64 ~WindowAndroid();
65
66 JavaObjectWeakGlobalRef weak_java_window_;
67 gfx::Vector2dF content_offset_;
68 WindowAndroidCompositor* compositor_;
69
70 ObserverList<WindowAndroidObserver> observer_list_;
71
72 DISALLOW_COPY_AND_ASSIGN(WindowAndroid);
73 };
74
75 } // namespace ui
76
77 #endif // UI_BASE_ANDROID_WINDOW_ANDROID_H_
OLDNEW
« no previous file with comments | « ui/base/android/view_android.cc ('k') | ui/base/android/window_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698