| 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_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include <jni.h> | 9 #include <jni.h> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 virtual void SelectBetweenCoordinates(JNIEnv* env, jobject obj, | 48 virtual void SelectBetweenCoordinates(JNIEnv* env, jobject obj, |
| 49 jint x1, jint y1, jint x2, jint y2) = 0; | 49 jint x1, jint y1, jint x2, jint y2) = 0; |
| 50 | 50 |
| 51 // -------------------------------------------------------------------------- | 51 // -------------------------------------------------------------------------- |
| 52 // Methods called from native code | 52 // Methods called from native code |
| 53 // -------------------------------------------------------------------------- | 53 // -------------------------------------------------------------------------- |
| 54 | 54 |
| 55 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 55 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
| 56 | 56 |
| 57 virtual ui::WindowAndroid* GetWindowAndroid() = 0; | 57 virtual ui::WindowAndroid* GetWindowAndroid() = 0; |
| 58 static ContentViewCore* FromWebContents(content::WebContents* web_contents); |
| 59 |
| 60 // Returns the WebContents for this ContentViewCore. The caller becomes the |
| 61 // owner of the returned WebContents and should ensure it lives as long as |
| 62 // this ContentViewCore. |
| 63 virtual content::WebContents* AcquireWebContents() = 0; |
| 64 |
| 65 // Called when the embedder replaces the actual WebContents, in |
| 66 // the prerendering case for example. |
| 67 // Important notes: the |old_web_contents| is released, meaning that it is |
| 68 // not deleted even if the ContentViewCore owns it. Also, the owner state is |
| 69 // carried over to the |new_web_contents|, meaning if the current WebContents |
| 70 // is owned, the new one will be owned as well (and vice-versa). |
| 71 virtual void ReplaceWebContents(content::WebContents* old_web_contents, |
| 72 content::WebContents* new_web_contents)= 0; |
| 73 |
| 74 // -------------------------------------------------------------------------- |
| 75 // Public methods that call to Java via JNI |
| 76 // -------------------------------------------------------------------------- |
| 77 |
| 78 virtual void DidStartLoading() = 0; |
| 79 virtual void OnPageStarted(const GURL& validated_url) = 0; |
| 80 virtual void OnPageFinished(const GURL& validated_url) = 0; |
| 81 virtual void OnPageFailed(int error_code, const string16& description, |
| 82 const GURL& failingUrl) = 0; |
| 83 |
| 84 virtual void OnDidCommitMainFrame(const GURL& url, const GURL& base_url) = 0; |
| 85 |
| 58 protected: | 86 protected: |
| 59 virtual ~ContentViewCore() {}; | 87 virtual ~ContentViewCore() {}; |
| 60 }; | 88 }; |
| 61 | 89 |
| 62 }; // namespace content | 90 }; // namespace content |
| 63 | 91 |
| 64 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_VIEW_CORE_H_ | 92 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_VIEW_CORE_H_ |
| OLD | NEW |