| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_helper.h" | 10 #include "base/android/jni_helper.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 bool hardware_accelerated, | 41 bool hardware_accelerated, |
| 42 WebContents* web_contents, | 42 WebContents* web_contents, |
| 43 ui::WindowAndroid* window_android); | 43 ui::WindowAndroid* window_android); |
| 44 | 44 |
| 45 // ContentViewCore implementation. | 45 // ContentViewCore implementation. |
| 46 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; | 46 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; |
| 47 virtual base::android::ScopedJavaLocalRef<jobject> GetContainerViewDelegate() | 47 virtual base::android::ScopedJavaLocalRef<jobject> GetContainerViewDelegate() |
| 48 OVERRIDE; | 48 OVERRIDE; |
| 49 virtual WebContents* GetWebContents() const OVERRIDE; | 49 virtual WebContents* GetWebContents() const OVERRIDE; |
| 50 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; | 50 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; |
| 51 virtual WebKit::WebLayer* GetWebLayer() const OVERRIDE; | 51 virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE; |
| 52 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; | 52 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; |
| 53 virtual void OnWebPreferencesUpdated() OVERRIDE; | 53 virtual void OnWebPreferencesUpdated() OVERRIDE; |
| 54 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; | 54 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; |
| 55 virtual void ShowPastePopup(int x, int y) OVERRIDE; | 55 virtual void ShowPastePopup(int x, int y) OVERRIDE; |
| 56 virtual unsigned int GetScaledContentTexture(const gfx::Size& size) OVERRIDE; | 56 virtual unsigned int GetScaledContentTexture(const gfx::Size& size) OVERRIDE; |
| 57 | 57 |
| 58 // -------------------------------------------------------------------------- | 58 // -------------------------------------------------------------------------- |
| 59 // Methods called from Java via JNI | 59 // Methods called from Java via JNI |
| 60 // -------------------------------------------------------------------------- | 60 // -------------------------------------------------------------------------- |
| 61 | 61 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // |zoomed_bitmap| --> magnified image of potential touch targets | 229 // |zoomed_bitmap| --> magnified image of potential touch targets |
| 230 void ShowDisambiguationPopup( | 230 void ShowDisambiguationPopup( |
| 231 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap); | 231 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap); |
| 232 | 232 |
| 233 // -------------------------------------------------------------------------- | 233 // -------------------------------------------------------------------------- |
| 234 // Methods called from native code | 234 // Methods called from native code |
| 235 // -------------------------------------------------------------------------- | 235 // -------------------------------------------------------------------------- |
| 236 | 236 |
| 237 gfx::Rect GetBounds() const; | 237 gfx::Rect GetBounds() const; |
| 238 | 238 |
| 239 void AttachWebLayer(WebKit::WebLayer* layer); | 239 void AttachLayer(scoped_refptr<cc::Layer> layer); |
| 240 void RemoveWebLayer(WebKit::WebLayer* layer); | 240 void RemoveLayer(scoped_refptr<cc::Layer> layer); |
| 241 | 241 |
| 242 private: | 242 private: |
| 243 class ContentViewUserData; | 243 class ContentViewUserData; |
| 244 | 244 |
| 245 friend class ContentViewUserData; | 245 friend class ContentViewUserData; |
| 246 virtual ~ContentViewCoreImpl(); | 246 virtual ~ContentViewCoreImpl(); |
| 247 | 247 |
| 248 // NotificationObserver implementation. | 248 // NotificationObserver implementation. |
| 249 virtual void Observe(int type, | 249 virtual void Observe(int type, |
| 250 const NotificationSource& source, | 250 const NotificationSource& source, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 273 | 273 |
| 274 // A weak reference to the Java ContentViewCore object. | 274 // A weak reference to the Java ContentViewCore object. |
| 275 JavaObjectWeakGlobalRef java_ref_; | 275 JavaObjectWeakGlobalRef java_ref_; |
| 276 | 276 |
| 277 NotificationRegistrar notification_registrar_; | 277 NotificationRegistrar notification_registrar_; |
| 278 | 278 |
| 279 // Reference to the current WebContents used to determine how and what to | 279 // Reference to the current WebContents used to determine how and what to |
| 280 // display in the ContentViewCore. | 280 // display in the ContentViewCore. |
| 281 WebContentsImpl* web_contents_; | 281 WebContentsImpl* web_contents_; |
| 282 | 282 |
| 283 // A WebLayer containing any WebLayer that should be shown. | 283 // A compositor layer containing any layer that should be shown. |
| 284 scoped_ptr<WebKit::WebLayer> root_layer_; | 284 scoped_refptr<cc::Layer> root_layer_; |
| 285 | 285 |
| 286 // Whether the renderer backing this ContentViewCore has crashed. | 286 // Whether the renderer backing this ContentViewCore has crashed. |
| 287 bool tab_crashed_; | 287 bool tab_crashed_; |
| 288 | 288 |
| 289 float dpi_scale_; | 289 float dpi_scale_; |
| 290 | 290 |
| 291 // The owning window that has a hold of main application activity. | 291 // The owning window that has a hold of main application activity. |
| 292 ui::WindowAndroid* window_android_; | 292 ui::WindowAndroid* window_android_; |
| 293 | 293 |
| 294 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 294 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 295 }; | 295 }; |
| 296 | 296 |
| 297 bool RegisterContentViewCore(JNIEnv* env); | 297 bool RegisterContentViewCore(JNIEnv* env); |
| 298 | 298 |
| 299 } // namespace content | 299 } // namespace content |
| 300 | 300 |
| 301 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 301 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |