| 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 14 matching lines...) Expand all Loading... |
| 25 #include "ui/gfx/rect_f.h" | 25 #include "ui/gfx/rect_f.h" |
| 26 #include "url/gurl.h" | 26 #include "url/gurl.h" |
| 27 | 27 |
| 28 namespace ui { | 28 namespace ui { |
| 29 class ViewAndroid; | 29 class ViewAndroid; |
| 30 class WindowAndroid; | 30 class WindowAndroid; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace content { | 33 namespace content { |
| 34 class RenderWidgetHostViewAndroid; | 34 class RenderWidgetHostViewAndroid; |
| 35 class Compositor; |
| 35 struct MenuItem; | 36 struct MenuItem; |
| 36 | 37 |
| 37 // TODO(jrg): this is a shell. Upstream the rest. | 38 // TODO(jrg): this is a shell. Upstream the rest. |
| 38 class ContentViewCoreImpl : public ContentViewCore, | 39 class ContentViewCoreImpl : public ContentViewCore, |
| 39 public NotificationObserver, | 40 public NotificationObserver, |
| 40 public WebContentsObserver { | 41 public WebContentsObserver { |
| 41 public: | 42 public: |
| 42 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); | 43 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); |
| 43 ContentViewCoreImpl(JNIEnv* env, | 44 ContentViewCoreImpl(JNIEnv* env, |
| 44 jobject obj, | 45 jobject obj, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 56 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; | 57 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; |
| 57 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; | 58 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; |
| 58 virtual void ShowPastePopup(int x, int y) OVERRIDE; | 59 virtual void ShowPastePopup(int x, int y) OVERRIDE; |
| 59 virtual unsigned int GetScaledContentTexture( | 60 virtual unsigned int GetScaledContentTexture( |
| 60 float scale, | 61 float scale, |
| 61 gfx::Size* out_size) OVERRIDE; | 62 gfx::Size* out_size) OVERRIDE; |
| 62 virtual float GetDpiScale() const OVERRIDE; | 63 virtual float GetDpiScale() const OVERRIDE; |
| 63 virtual void RequestContentClipping(const gfx::Rect& clipping, | 64 virtual void RequestContentClipping(const gfx::Rect& clipping, |
| 64 const gfx::Size& content_size) OVERRIDE; | 65 const gfx::Size& content_size) OVERRIDE; |
| 65 virtual void PauseVideo() OVERRIDE; | 66 virtual void PauseVideo() OVERRIDE; |
| 67 virtual void SetCompositor(Compositor* compositor) OVERRIDE; |
| 68 virtual Compositor* GetCompositor() const OVERRIDE { return compositor_; } |
| 66 | 69 |
| 67 // -------------------------------------------------------------------------- | 70 // -------------------------------------------------------------------------- |
| 68 // Methods called from Java via JNI | 71 // Methods called from Java via JNI |
| 69 // -------------------------------------------------------------------------- | 72 // -------------------------------------------------------------------------- |
| 70 | 73 |
| 71 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); | 74 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); |
| 72 | 75 |
| 73 // Notifies the ContentViewCore that items were selected in the currently | 76 // Notifies the ContentViewCore that items were selected in the currently |
| 74 // showing select popup. | 77 // showing select popup. |
| 75 void SelectPopupMenuItems(JNIEnv* env, jobject obj, jintArray indices); | 78 void SelectPopupMenuItems(JNIEnv* env, jobject obj, jintArray indices); |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // like AutofillPopup. | 381 // like AutofillPopup. |
| 379 ui::ViewAndroid* view_android_; | 382 ui::ViewAndroid* view_android_; |
| 380 | 383 |
| 381 // The owning window that has a hold of main application activity. | 384 // The owning window that has a hold of main application activity. |
| 382 ui::WindowAndroid* window_android_; | 385 ui::WindowAndroid* window_android_; |
| 383 | 386 |
| 384 // The cache of device's current orientation set from Java side, this value | 387 // The cache of device's current orientation set from Java side, this value |
| 385 // will be sent to Renderer once it is ready. | 388 // will be sent to Renderer once it is ready. |
| 386 int device_orientation_; | 389 int device_orientation_; |
| 387 | 390 |
| 391 // ContentViewCore does not own the compositor. This reference is kept to |
| 392 // allow for adding observers to the compositor. |
| 393 Compositor* compositor_; |
| 394 |
| 388 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 395 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 389 }; | 396 }; |
| 390 | 397 |
| 391 bool RegisterContentViewCore(JNIEnv* env); | 398 bool RegisterContentViewCore(JNIEnv* env); |
| 392 | 399 |
| 393 } // namespace content | 400 } // namespace content |
| 394 | 401 |
| 395 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 402 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |