| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 jint ua_override_option, | 82 jint ua_override_option, |
| 83 jstring extra_headers, | 83 jstring extra_headers, |
| 84 jbyteArray post_data, | 84 jbyteArray post_data, |
| 85 jstring base_url_for_data_url, | 85 jstring base_url_for_data_url, |
| 86 jstring virtual_url_for_data_url, | 86 jstring virtual_url_for_data_url, |
| 87 jboolean can_load_local_resources); | 87 jboolean can_load_local_resources); |
| 88 base::android::ScopedJavaLocalRef<jstring> GetURL(JNIEnv* env, jobject) const; | 88 base::android::ScopedJavaLocalRef<jstring> GetURL(JNIEnv* env, jobject) const; |
| 89 base::android::ScopedJavaLocalRef<jstring> GetTitle( | 89 base::android::ScopedJavaLocalRef<jstring> GetTitle( |
| 90 JNIEnv* env, jobject obj) const; | 90 JNIEnv* env, jobject obj) const; |
| 91 jboolean IsIncognito(JNIEnv* env, jobject obj); | 91 jboolean IsIncognito(JNIEnv* env, jobject obj); |
| 92 jboolean Crashed(JNIEnv* env, jobject obj) const { return tab_crashed_; } | |
| 93 void SendOrientationChangeEvent(JNIEnv* env, jobject obj, jint orientation); | 92 void SendOrientationChangeEvent(JNIEnv* env, jobject obj, jint orientation); |
| 94 jboolean SendTouchEvent(JNIEnv* env, | 93 jboolean SendTouchEvent(JNIEnv* env, |
| 95 jobject obj, | 94 jobject obj, |
| 96 jlong time_ms, | 95 jlong time_ms, |
| 97 jint type, | 96 jint type, |
| 98 jobjectArray pts); | 97 jobjectArray pts); |
| 99 jboolean SendMouseMoveEvent(JNIEnv* env, | 98 jboolean SendMouseMoveEvent(JNIEnv* env, |
| 100 jobject obj, | 99 jobject obj, |
| 101 jlong time_ms, | 100 jlong time_ms, |
| 102 jfloat x, | 101 jfloat x, |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 344 |
| 346 void SendBeginFrame(base::TimeTicks frame_time); | 345 void SendBeginFrame(base::TimeTicks frame_time); |
| 347 | 346 |
| 348 gfx::Size GetViewportSizePix() const; | 347 gfx::Size GetViewportSizePix() const; |
| 349 gfx::Size GetViewportSizeOffsetPix() const; | 348 gfx::Size GetViewportSizeOffsetPix() const; |
| 350 | 349 |
| 351 void DeleteScaledSnapshotTexture(); | 350 void DeleteScaledSnapshotTexture(); |
| 352 | 351 |
| 353 void SendGestureEvent(const blink::WebGestureEvent& event); | 352 void SendGestureEvent(const blink::WebGestureEvent& event); |
| 354 | 353 |
| 355 // Checks if there there is a corresponding renderer process and updates | |
| 356 // |tab_crashed_| accordingly. | |
| 357 void UpdateTabCrashedFlag(); | |
| 358 | |
| 359 // Update focus state of the RenderWidgetHostView. | 354 // Update focus state of the RenderWidgetHostView. |
| 360 void SetFocusInternal(bool focused); | 355 void SetFocusInternal(bool focused); |
| 361 | 356 |
| 362 // Send device_orientation_ to renderer. | 357 // Send device_orientation_ to renderer. |
| 363 void SendOrientationChangeEventInternal(); | 358 void SendOrientationChangeEventInternal(); |
| 364 | 359 |
| 365 // A weak reference to the Java ContentViewCore object. | 360 // A weak reference to the Java ContentViewCore object. |
| 366 JavaObjectWeakGlobalRef java_ref_; | 361 JavaObjectWeakGlobalRef java_ref_; |
| 367 | 362 |
| 368 NotificationRegistrar notification_registrar_; | 363 NotificationRegistrar notification_registrar_; |
| 369 | 364 |
| 370 // Reference to the current WebContents used to determine how and what to | 365 // Reference to the current WebContents used to determine how and what to |
| 371 // display in the ContentViewCore. | 366 // display in the ContentViewCore. |
| 372 WebContentsImpl* web_contents_; | 367 WebContentsImpl* web_contents_; |
| 373 | 368 |
| 374 // A compositor layer containing any layer that should be shown. | 369 // A compositor layer containing any layer that should be shown. |
| 375 scoped_refptr<cc::Layer> root_layer_; | 370 scoped_refptr<cc::Layer> root_layer_; |
| 376 | 371 |
| 377 // Whether the renderer backing this ContentViewCore has crashed. | |
| 378 bool tab_crashed_; | |
| 379 | |
| 380 // Device scale factor. | 372 // Device scale factor. |
| 381 float dpi_scale_; | 373 float dpi_scale_; |
| 382 | 374 |
| 383 // Variables used to keep track of frame timestamps and deadlines. | 375 // Variables used to keep track of frame timestamps and deadlines. |
| 384 base::TimeDelta vsync_interval_; | 376 base::TimeDelta vsync_interval_; |
| 385 base::TimeDelta expected_browser_composite_time_; | 377 base::TimeDelta expected_browser_composite_time_; |
| 386 | 378 |
| 387 // The Android view that can be used to add and remove decoration layers | 379 // The Android view that can be used to add and remove decoration layers |
| 388 // like AutofillPopup. | 380 // like AutofillPopup. |
| 389 ui::ViewAndroid* view_android_; | 381 ui::ViewAndroid* view_android_; |
| 390 | 382 |
| 391 // The owning window that has a hold of main application activity. | 383 // The owning window that has a hold of main application activity. |
| 392 ui::WindowAndroid* window_android_; | 384 ui::WindowAndroid* window_android_; |
| 393 | 385 |
| 394 // The cache of device's current orientation set from Java side, this value | 386 // The cache of device's current orientation set from Java side, this value |
| 395 // will be sent to Renderer once it is ready. | 387 // will be sent to Renderer once it is ready. |
| 396 int device_orientation_; | 388 int device_orientation_; |
| 397 | 389 |
| 398 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 390 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 399 }; | 391 }; |
| 400 | 392 |
| 401 bool RegisterContentViewCore(JNIEnv* env); | 393 bool RegisterContentViewCore(JNIEnv* env); |
| 402 | 394 |
| 403 } // namespace content | 395 } // namespace content |
| 404 | 396 |
| 405 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 397 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |