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 WasResized(JNIEnv* env, jobject obj); | 199 void WasResized(JNIEnv* env, jobject obj); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 368 |
368 // The owning window that has a hold of main application activity. | 369 // The owning window that has a hold of main application activity. |
369 ui::WindowAndroid* window_android_; | 370 ui::WindowAndroid* window_android_; |
370 | 371 |
371 // The cache of device's current orientation set from Java side, this value | 372 // The cache of device's current orientation set from Java side, this value |
372 // will be sent to Renderer once it is ready. | 373 // will be sent to Renderer once it is ready. |
373 int device_orientation_; | 374 int device_orientation_; |
374 | 375 |
375 bool geolocation_needs_pause_; | 376 bool geolocation_needs_pause_; |
376 | 377 |
| 378 // Manages injecting Java objects. |
| 379 scoped_ptr<JavaBridgeDispatcherHostManager> |
| 380 java_bridge_dispatcher_host_manager_; |
| 381 |
377 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 382 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
378 }; | 383 }; |
379 | 384 |
380 bool RegisterContentViewCore(JNIEnv* env); | 385 bool RegisterContentViewCore(JNIEnv* env); |
381 | 386 |
382 } // namespace content | 387 } // namespace content |
383 | 388 |
384 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 389 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |