| 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 13 matching lines...) Expand all Loading... |
| 24 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
| 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 JavaBridgeDispatcherHostManager; |
| 34 class RenderWidgetHostViewAndroid; | 35 class RenderWidgetHostViewAndroid; |
| 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, |
| 45 WebContents* web_contents, | 46 WebContents* web_contents, |
| 46 ui::ViewAndroid* view_android, | 47 ui::ViewAndroid* view_android, |
| 47 ui::WindowAndroid* window_android); | 48 ui::WindowAndroid* window_android, |
| 49 jobject java_bridge_retained_object_set); |
| 48 | 50 |
| 49 // ContentViewCore implementation. | 51 // ContentViewCore implementation. |
| 50 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; | 52 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; |
| 51 virtual WebContents* GetWebContents() const OVERRIDE; | 53 virtual WebContents* GetWebContents() const OVERRIDE; |
| 52 virtual ui::ViewAndroid* GetViewAndroid() const OVERRIDE; | 54 virtual ui::ViewAndroid* GetViewAndroid() const OVERRIDE; |
| 53 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; | 55 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; |
| 54 virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE; | 56 virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE; |
| 55 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; | 57 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; |
| 56 virtual void ShowPastePopup(int x, int y) OVERRIDE; | 58 virtual void ShowPastePopup(int x, int y) OVERRIDE; |
| 57 virtual void GetScaledContentBitmap( | 59 virtual void GetScaledContentBitmap( |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 bool GetUseDesktopUserAgent(JNIEnv* env, jobject /* obj */); | 179 bool GetUseDesktopUserAgent(JNIEnv* env, jobject /* obj */); |
| 178 void Show(); | 180 void Show(); |
| 179 void Hide(); | 181 void Hide(); |
| 180 void SetAllowJavascriptInterfacesInspection(JNIEnv* env, | 182 void SetAllowJavascriptInterfacesInspection(JNIEnv* env, |
| 181 jobject obj, | 183 jobject obj, |
| 182 jboolean allow); | 184 jboolean allow); |
| 183 void AddJavascriptInterface(JNIEnv* env, | 185 void AddJavascriptInterface(JNIEnv* env, |
| 184 jobject obj, | 186 jobject obj, |
| 185 jobject object, | 187 jobject object, |
| 186 jstring name, | 188 jstring name, |
| 187 jclass safe_annotation_clazz, | 189 jclass safe_annotation_clazz); |
| 188 jobject retained_object_set); | |
| 189 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); | 190 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); |
| 190 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject history); | 191 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject history); |
| 191 void GetDirectedNavigationHistory(JNIEnv* env, | 192 void GetDirectedNavigationHistory(JNIEnv* env, |
| 192 jobject obj, | 193 jobject obj, |
| 193 jobject history, | 194 jobject history, |
| 194 jboolean is_forward, | 195 jboolean is_forward, |
| 195 jint max_entries); | 196 jint max_entries); |
| 196 base::android::ScopedJavaLocalRef<jstring> | 197 base::android::ScopedJavaLocalRef<jstring> |
| 197 GetOriginalUrlForActiveNavigationEntry(JNIEnv* env, jobject obj); | 198 GetOriginalUrlForActiveNavigationEntry(JNIEnv* env, jobject obj); |
| 198 void UpdateVSyncParameters(JNIEnv* env, jobject obj, jlong timebase_micros, | 199 void UpdateVSyncParameters(JNIEnv* env, jobject obj, jlong timebase_micros, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 | 382 |
| 382 // The owning window that has a hold of main application activity. | 383 // The owning window that has a hold of main application activity. |
| 383 ui::WindowAndroid* window_android_; | 384 ui::WindowAndroid* window_android_; |
| 384 | 385 |
| 385 // The cache of device's current orientation set from Java side, this value | 386 // The cache of device's current orientation set from Java side, this value |
| 386 // will be sent to Renderer once it is ready. | 387 // will be sent to Renderer once it is ready. |
| 387 int device_orientation_; | 388 int device_orientation_; |
| 388 | 389 |
| 389 bool geolocation_needs_pause_; | 390 bool geolocation_needs_pause_; |
| 390 | 391 |
| 392 // Manages injecting Java objects. |
| 393 scoped_ptr<JavaBridgeDispatcherHostManager> |
| 394 java_bridge_dispatcher_host_manager_; |
| 395 |
| 391 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 396 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 392 }; | 397 }; |
| 393 | 398 |
| 394 bool RegisterContentViewCore(JNIEnv* env); | 399 bool RegisterContentViewCore(JNIEnv* env); |
| 395 | 400 |
| 396 } // namespace content | 401 } // namespace content |
| 397 | 402 |
| 398 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 403 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |