| OLD | NEW |
| 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_BASE_ANDROID_WINDOW_ANDROID_H_ | 5 #ifndef UI_BASE_ANDROID_WINDOW_ANDROID_H_ |
| 6 #define UI_BASE_ANDROID_WINDOW_ANDROID_H_ | 6 #define UI_BASE_ANDROID_WINDOW_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); | 29 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); |
| 30 | 30 |
| 31 static bool RegisterWindowAndroid(JNIEnv* env); | 31 static bool RegisterWindowAndroid(JNIEnv* env); |
| 32 | 32 |
| 33 // The content offset is used to translate snapshots to the correct part of | 33 // The content offset is used to translate snapshots to the correct part of |
| 34 // the window. | 34 // the window. |
| 35 void set_content_offset(const gfx::Vector2dF& content_offset) { | 35 void set_content_offset(const gfx::Vector2dF& content_offset) { |
| 36 content_offset_ = content_offset; | 36 content_offset_ = content_offset; |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool GrabSnapshot(int content_x, int content_y, int width, int height, | |
| 40 std::vector<unsigned char>* png_representation); | |
| 41 | |
| 42 // Compositor callback relay. | 39 // Compositor callback relay. |
| 43 void OnCompositingDidCommit(); | 40 void OnCompositingDidCommit(); |
| 44 | 41 |
| 45 void AttachCompositor(WindowAndroidCompositor* compositor); | 42 void AttachCompositor(WindowAndroidCompositor* compositor); |
| 46 void DetachCompositor(); | 43 void DetachCompositor(); |
| 47 | 44 |
| 48 void AddObserver(WindowAndroidObserver* observer); | 45 void AddObserver(WindowAndroidObserver* observer); |
| 49 void RemoveObserver(WindowAndroidObserver* observer); | 46 void RemoveObserver(WindowAndroidObserver* observer); |
| 50 | 47 |
| 51 WindowAndroidCompositor* GetCompositor() { return compositor_; } | 48 WindowAndroidCompositor* GetCompositor() { return compositor_; } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 62 base::TimeDelta vsync_period_; | 59 base::TimeDelta vsync_period_; |
| 63 | 60 |
| 64 ObserverList<WindowAndroidObserver> observer_list_; | 61 ObserverList<WindowAndroidObserver> observer_list_; |
| 65 | 62 |
| 66 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); | 63 DISALLOW_COPY_AND_ASSIGN(WindowAndroid); |
| 67 }; | 64 }; |
| 68 | 65 |
| 69 } // namespace ui | 66 } // namespace ui |
| 70 | 67 |
| 71 #endif // UI_BASE_ANDROID_WINDOW_ANDROID_H_ | 68 #endif // UI_BASE_ANDROID_WINDOW_ANDROID_H_ |
| OLD | NEW |