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