| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // |zoomed_bitmap| --> magnified image of potential touch targets | 228 // |zoomed_bitmap| --> magnified image of potential touch targets |
| 229 void ShowDisambiguationPopup( | 229 void ShowDisambiguationPopup( |
| 230 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap); | 230 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap); |
| 231 | 231 |
| 232 // -------------------------------------------------------------------------- | 232 // -------------------------------------------------------------------------- |
| 233 // Methods called from native code | 233 // Methods called from native code |
| 234 // -------------------------------------------------------------------------- | 234 // -------------------------------------------------------------------------- |
| 235 | 235 |
| 236 gfx::Rect GetBounds() const; | 236 gfx::Rect GetBounds() const; |
| 237 | 237 |
| 238 void AttachWebLayer(WebKit::WebLayer* layer); | 238 void AttachLayer(scoped_refptr<cc::Layer> layer); |
| 239 void RemoveWebLayer(WebKit::WebLayer* layer); | 239 void RemoveLayer(scoped_refptr<cc::Layer> layer); |
| 240 | 240 |
| 241 private: | 241 private: |
| 242 class ContentViewUserData; | 242 class ContentViewUserData; |
| 243 | 243 |
| 244 friend class ContentViewUserData; | 244 friend class ContentViewUserData; |
| 245 virtual ~ContentViewCoreImpl(); | 245 virtual ~ContentViewCoreImpl(); |
| 246 | 246 |
| 247 // NotificationObserver implementation. | 247 // NotificationObserver implementation. |
| 248 virtual void Observe(int type, | 248 virtual void Observe(int type, |
| 249 const NotificationSource& source, | 249 const NotificationSource& source, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 272 | 272 |
| 273 // A weak reference to the Java ContentViewCore object. | 273 // A weak reference to the Java ContentViewCore object. |
| 274 JavaObjectWeakGlobalRef java_ref_; | 274 JavaObjectWeakGlobalRef java_ref_; |
| 275 | 275 |
| 276 NotificationRegistrar notification_registrar_; | 276 NotificationRegistrar notification_registrar_; |
| 277 | 277 |
| 278 // Reference to the current WebContents used to determine how and what to | 278 // Reference to the current WebContents used to determine how and what to |
| 279 // display in the ContentViewCore. | 279 // display in the ContentViewCore. |
| 280 WebContentsImpl* web_contents_; | 280 WebContentsImpl* web_contents_; |
| 281 | 281 |
| 282 // A WebLayer containing any WebLayer that should be shown. | 282 // A compositor layer containing any layer that should be shown. |
| 283 scoped_ptr<WebKit::WebLayer> root_layer_; | 283 scoped_refptr<cc::Layer> root_layer_; |
| 284 | 284 |
| 285 // Whether the renderer backing this ContentViewCore has crashed. | 285 // Whether the renderer backing this ContentViewCore has crashed. |
| 286 bool tab_crashed_; | 286 bool tab_crashed_; |
| 287 | 287 |
| 288 float dpi_scale_; | 288 float dpi_scale_; |
| 289 | 289 |
| 290 // The owning window that has a hold of main application activity. | 290 // The owning window that has a hold of main application activity. |
| 291 ui::WindowAndroid* window_android_; | 291 ui::WindowAndroid* window_android_; |
| 292 | 292 |
| 293 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 293 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 bool RegisterContentViewCore(JNIEnv* env); | 296 bool RegisterContentViewCore(JNIEnv* env); |
| 297 | 297 |
| 298 } // namespace content | 298 } // namespace content |
| 299 | 299 |
| 300 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 300 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |