| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 jobject retained_object_set); | 196 jobject retained_object_set); |
| 197 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); | 197 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); |
| 198 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject history); | 198 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject history); |
| 199 void GetDirectedNavigationHistory(JNIEnv* env, | 199 void GetDirectedNavigationHistory(JNIEnv* env, |
| 200 jobject obj, | 200 jobject obj, |
| 201 jobject history, | 201 jobject history, |
| 202 jboolean is_forward, | 202 jboolean is_forward, |
| 203 jint max_entries); | 203 jint max_entries); |
| 204 base::android::ScopedJavaLocalRef<jstring> | 204 base::android::ScopedJavaLocalRef<jstring> |
| 205 GetOriginalUrlForActiveNavigationEntry(JNIEnv* env, jobject obj); | 205 GetOriginalUrlForActiveNavigationEntry(JNIEnv* env, jobject obj); |
| 206 void UpdateVSyncParameters(JNIEnv* env, jobject obj, jlong timebase_micros, | |
| 207 jlong interval_micros); | |
| 208 void OnVSync(JNIEnv* env, jobject /* obj */, jlong frame_time_micros); | |
| 209 jboolean OnAnimate(JNIEnv* env, jobject /* obj */, jlong frame_time_micros); | |
| 210 void WasResized(JNIEnv* env, jobject obj); | 206 void WasResized(JNIEnv* env, jobject obj); |
| 211 jboolean IsRenderWidgetHostViewReady(JNIEnv* env, jobject obj); | 207 jboolean IsRenderWidgetHostViewReady(JNIEnv* env, jobject obj); |
| 212 void ExitFullscreen(JNIEnv* env, jobject obj); | 208 void ExitFullscreen(JNIEnv* env, jobject obj); |
| 213 void UpdateTopControlsState(JNIEnv* env, | 209 void UpdateTopControlsState(JNIEnv* env, |
| 214 jobject obj, | 210 jobject obj, |
| 215 bool enable_hiding, | 211 bool enable_hiding, |
| 216 bool enable_showing, | 212 bool enable_showing, |
| 217 bool animate); | 213 bool animate); |
| 218 void ShowImeIfNeeded(JNIEnv* env, jobject obj); | 214 void ShowImeIfNeeded(JNIEnv* env, jobject obj); |
| 219 | 215 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 // Methods called from native code | 303 // Methods called from native code |
| 308 // -------------------------------------------------------------------------- | 304 // -------------------------------------------------------------------------- |
| 309 | 305 |
| 310 gfx::Size GetPhysicalBackingSize() const; | 306 gfx::Size GetPhysicalBackingSize() const; |
| 311 gfx::Size GetViewportSizeDip() const; | 307 gfx::Size GetViewportSizeDip() const; |
| 312 gfx::Size GetViewportSizeOffsetDip() const; | 308 gfx::Size GetViewportSizeOffsetDip() const; |
| 313 float GetOverdrawBottomHeightDip() const; | 309 float GetOverdrawBottomHeightDip() const; |
| 314 | 310 |
| 315 void AttachLayer(scoped_refptr<cc::Layer> layer); | 311 void AttachLayer(scoped_refptr<cc::Layer> layer); |
| 316 void RemoveLayer(scoped_refptr<cc::Layer> layer); | 312 void RemoveLayer(scoped_refptr<cc::Layer> layer); |
| 317 void AddBeginFrameSubscriber(); | |
| 318 void RemoveBeginFrameSubscriber(); | |
| 319 void SetNeedsAnimate(); | |
| 320 | 313 |
| 321 private: | 314 private: |
| 322 class ContentViewUserData; | 315 class ContentViewUserData; |
| 323 | 316 |
| 324 friend class ContentViewUserData; | 317 friend class ContentViewUserData; |
| 325 virtual ~ContentViewCoreImpl(); | 318 virtual ~ContentViewCoreImpl(); |
| 326 | 319 |
| 327 // NotificationObserver implementation. | 320 // NotificationObserver implementation. |
| 328 virtual void Observe(int type, | 321 virtual void Observe(int type, |
| 329 const NotificationSource& source, | 322 const NotificationSource& source, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 340 // Other private methods and data | 333 // Other private methods and data |
| 341 // -------------------------------------------------------------------------- | 334 // -------------------------------------------------------------------------- |
| 342 | 335 |
| 343 void InitWebContents(); | 336 void InitWebContents(); |
| 344 | 337 |
| 345 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid(); | 338 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid(); |
| 346 | 339 |
| 347 blink::WebGestureEvent MakeGestureEvent( | 340 blink::WebGestureEvent MakeGestureEvent( |
| 348 blink::WebInputEvent::Type type, int64 time_ms, float x, float y) const; | 341 blink::WebInputEvent::Type type, int64 time_ms, float x, float y) const; |
| 349 | 342 |
| 350 void SendBeginFrame(base::TimeTicks frame_time); | |
| 351 | |
| 352 gfx::Size GetViewportSizePix() const; | 343 gfx::Size GetViewportSizePix() const; |
| 353 gfx::Size GetViewportSizeOffsetPix() const; | 344 gfx::Size GetViewportSizeOffsetPix() const; |
| 354 | 345 |
| 355 void DeleteScaledSnapshotTexture(); | 346 void DeleteScaledSnapshotTexture(); |
| 356 | 347 |
| 357 bool OnMotionEvent(const ui::MotionEvent& event); | 348 bool OnMotionEvent(const ui::MotionEvent& event); |
| 358 void SendGestureEvent(const blink::WebGestureEvent& event); | 349 void SendGestureEvent(const blink::WebGestureEvent& event); |
| 359 | 350 |
| 360 // Update focus state of the RenderWidgetHostView. | 351 // Update focus state of the RenderWidgetHostView. |
| 361 void SetFocusInternal(bool focused); | 352 void SetFocusInternal(bool focused); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 377 // Reference to the current WebContents used to determine how and what to | 368 // Reference to the current WebContents used to determine how and what to |
| 378 // display in the ContentViewCore. | 369 // display in the ContentViewCore. |
| 379 WebContentsImpl* web_contents_; | 370 WebContentsImpl* web_contents_; |
| 380 | 371 |
| 381 // A compositor layer containing any layer that should be shown. | 372 // A compositor layer containing any layer that should be shown. |
| 382 scoped_refptr<cc::Layer> root_layer_; | 373 scoped_refptr<cc::Layer> root_layer_; |
| 383 | 374 |
| 384 // Device scale factor. | 375 // Device scale factor. |
| 385 float dpi_scale_; | 376 float dpi_scale_; |
| 386 | 377 |
| 387 // Variables used to keep track of frame timestamps and deadlines. | |
| 388 base::TimeDelta vsync_interval_; | |
| 389 base::TimeDelta expected_browser_composite_time_; | |
| 390 | |
| 391 // The Android view that can be used to add and remove decoration layers | 378 // The Android view that can be used to add and remove decoration layers |
| 392 // like AutofillPopup. | 379 // like AutofillPopup. |
| 393 ui::ViewAndroid* view_android_; | 380 ui::ViewAndroid* view_android_; |
| 394 | 381 |
| 395 // The owning window that has a hold of main application activity. | 382 // The owning window that has a hold of main application activity. |
| 396 ui::WindowAndroid* window_android_; | 383 ui::WindowAndroid* window_android_; |
| 397 | 384 |
| 398 // Provides gesture synthesis given a stream of touch events (derived from | 385 // Provides gesture synthesis given a stream of touch events (derived from |
| 399 // Android MotionEvent's) and touch event acks. | 386 // Android MotionEvent's) and touch event acks. |
| 400 ui::FilteredGestureProvider gesture_provider_; | 387 ui::FilteredGestureProvider gesture_provider_; |
| 401 | 388 |
| 402 // The cache of device's current orientation set from Java side, this value | 389 // The cache of device's current orientation set from Java side, this value |
| 403 // will be sent to Renderer once it is ready. | 390 // will be sent to Renderer once it is ready. |
| 404 int device_orientation_; | 391 int device_orientation_; |
| 405 | 392 |
| 406 bool geolocation_needs_pause_; | 393 bool geolocation_needs_pause_; |
| 407 | 394 |
| 408 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 395 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 409 }; | 396 }; |
| 410 | 397 |
| 411 bool RegisterContentViewCore(JNIEnv* env); | 398 bool RegisterContentViewCore(JNIEnv* env); |
| 412 | 399 |
| 413 } // namespace content | 400 } // namespace content |
| 414 | 401 |
| 415 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 402 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |