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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 public ui::OverscrollRefreshHandler, | 49 public ui::OverscrollRefreshHandler, |
50 public WebContentsObserver { | 50 public WebContentsObserver { |
51 public: | 51 public: |
52 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); | 52 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); |
53 ContentViewCoreImpl( | 53 ContentViewCoreImpl( |
54 JNIEnv* env, | 54 JNIEnv* env, |
55 const base::android::JavaRef<jobject>& obj, | 55 const base::android::JavaRef<jobject>& obj, |
56 WebContents* web_contents, | 56 WebContents* web_contents, |
57 const base::android::JavaRef<jobject>& view_android_delegate, | 57 const base::android::JavaRef<jobject>& view_android_delegate, |
58 ui::WindowAndroid* window_android, | 58 ui::WindowAndroid* window_android, |
| 59 float dpi_scale, |
59 const base::android::JavaRef<jobject>& java_bridge_retained_object_set); | 60 const base::android::JavaRef<jobject>& java_bridge_retained_object_set); |
60 | 61 |
61 // ContentViewCore implementation. | 62 // ContentViewCore implementation. |
62 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; | 63 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; |
63 WebContents* GetWebContents() const override; | 64 WebContents* GetWebContents() const override; |
64 ui::WindowAndroid* GetWindowAndroid() const override; | 65 ui::WindowAndroid* GetWindowAndroid() const override; |
65 void ShowPastePopup(int x, int y) override; | 66 void ShowPastePopup(int x, int y) override; |
66 void PauseOrResumeGeolocation(bool should_pause) override; | 67 void PauseOrResumeGeolocation(bool should_pause) override; |
67 | 68 |
68 void AddObserver(ContentViewCoreImplObserver* observer); | 69 void AddObserver(ContentViewCoreImplObserver* observer); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 JNIEnv* env, | 218 JNIEnv* env, |
218 const base::android::JavaParamRef<jobject>& obj, | 219 const base::android::JavaParamRef<jobject>& obj, |
219 jboolean enabled); | 220 jboolean enabled); |
220 | 221 |
221 long GetNativeImeAdapter(JNIEnv* env, | 222 long GetNativeImeAdapter(JNIEnv* env, |
222 const base::android::JavaParamRef<jobject>& obj); | 223 const base::android::JavaParamRef<jobject>& obj); |
223 void SetFocus(JNIEnv* env, | 224 void SetFocus(JNIEnv* env, |
224 const base::android::JavaParamRef<jobject>& obj, | 225 const base::android::JavaParamRef<jobject>& obj, |
225 jboolean focused); | 226 jboolean focused); |
226 | 227 |
| 228 void SetDIPScale(JNIEnv* env, |
| 229 const base::android::JavaParamRef<jobject>& obj, |
| 230 jfloat dipScale); |
| 231 |
227 jint GetBackgroundColor(JNIEnv* env, jobject obj); | 232 jint GetBackgroundColor(JNIEnv* env, jobject obj); |
228 void SetAllowJavascriptInterfacesInspection( | 233 void SetAllowJavascriptInterfacesInspection( |
229 JNIEnv* env, | 234 JNIEnv* env, |
230 const base::android::JavaParamRef<jobject>& obj, | 235 const base::android::JavaParamRef<jobject>& obj, |
231 jboolean allow); | 236 jboolean allow); |
232 void AddJavascriptInterface( | 237 void AddJavascriptInterface( |
233 JNIEnv* env, | 238 JNIEnv* env, |
234 const base::android::JavaParamRef<jobject>& obj, | 239 const base::android::JavaParamRef<jobject>& obj, |
235 const base::android::JavaParamRef<jobject>& object, | 240 const base::android::JavaParamRef<jobject>& object, |
236 const base::android::JavaParamRef<jstring>& name, | 241 const base::android::JavaParamRef<jstring>& name, |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 bool PullStart() override; | 413 bool PullStart() override; |
409 void PullUpdate(float delta) override; | 414 void PullUpdate(float delta) override; |
410 void PullRelease(bool allow_refresh) override; | 415 void PullRelease(bool allow_refresh) override; |
411 void PullReset() override; | 416 void PullReset() override; |
412 | 417 |
413 // -------------------------------------------------------------------------- | 418 // -------------------------------------------------------------------------- |
414 // Other private methods and data | 419 // Other private methods and data |
415 // -------------------------------------------------------------------------- | 420 // -------------------------------------------------------------------------- |
416 | 421 |
417 void InitWebContents(); | 422 void InitWebContents(); |
| 423 void SendScreenRectsAndResizeWidget(); |
418 | 424 |
419 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; | 425 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; |
420 | 426 |
421 blink::WebGestureEvent MakeGestureEvent(blink::WebInputEvent::Type type, | 427 blink::WebGestureEvent MakeGestureEvent(blink::WebInputEvent::Type type, |
422 int64_t time_ms, | 428 int64_t time_ms, |
423 float x, | 429 float x, |
424 float y) const; | 430 float y) const; |
425 | 431 |
426 gfx::Size GetViewportSizePix() const; | 432 gfx::Size GetViewportSizePix() const; |
427 int GetTopControlsHeightPix() const; | 433 int GetTopControlsHeightPix() const; |
(...skipping 18 matching lines...) Expand all Loading... |
446 ui::ViewAndroid view_; | 452 ui::ViewAndroid view_; |
447 | 453 |
448 // Reference to the current WebContents used to determine how and what to | 454 // Reference to the current WebContents used to determine how and what to |
449 // display in the ContentViewCore. | 455 // display in the ContentViewCore. |
450 WebContentsImpl* web_contents_; | 456 WebContentsImpl* web_contents_; |
451 | 457 |
452 // Page scale factor. | 458 // Page scale factor. |
453 float page_scale_; | 459 float page_scale_; |
454 | 460 |
455 // Device scale factor. | 461 // Device scale factor. |
456 const float dpi_scale_; | 462 float dpi_scale_; |
457 | 463 |
458 // Observer to notify of lifecyle changes. | 464 // Observer to notify of lifecyle changes. |
459 base::ObserverList<ContentViewCoreImplObserver> observer_list_; | 465 base::ObserverList<ContentViewCoreImplObserver> observer_list_; |
460 | 466 |
461 // The cache of device's current orientation set from Java side, this value | 467 // The cache of device's current orientation set from Java side, this value |
462 // will be sent to Renderer once it is ready. | 468 // will be sent to Renderer once it is ready. |
463 int device_orientation_; | 469 int device_orientation_; |
464 | 470 |
465 bool accessibility_enabled_; | 471 bool accessibility_enabled_; |
466 | 472 |
467 // Manages injecting Java objects. | 473 // Manages injecting Java objects. |
468 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; | 474 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; |
469 | 475 |
470 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 476 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
471 }; | 477 }; |
472 | 478 |
473 bool RegisterContentViewCore(JNIEnv* env); | 479 bool RegisterContentViewCore(JNIEnv* env); |
474 | 480 |
475 } // namespace content | 481 } // namespace content |
476 | 482 |
477 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 483 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |