Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Side by Side Diff: content/public/browser/android/content_view_core.h

Issue 10908285: Add WebContents accessor in ContentViewCore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 class GURL;
12
13 namespace ui { 11 namespace ui {
14 class WindowAndroid; 12 class WindowAndroid;
15 } 13 }
16 14
17 namespace content { 15 namespace content {
18
19 class WebContents; 16 class WebContents;
20 17
21 // Native side of the ContentViewCore.java, which is the primary way of 18 // Native side of the ContentViewCore.java, which is the primary way of
22 // communicating with the native Chromium code on Android. This is a 19 // communicating with the native Chromium code on Android. This is a
23 // public interface used by native code outside of the content module. 20 // public interface used by native code outside of the content module.
24 // 21 //
25 // TODO(jrg): this is a shell. Upstream the rest.
26 //
27 // TODO(jrg): downstream, this class derives from 22 // TODO(jrg): downstream, this class derives from
28 // base::SupportsWeakPtr<ContentViewCore>. Issues raised in 23 // base::SupportsWeakPtr<ContentViewCore>. Issues raised in
29 // http://codereview.chromium.org/10536066/ make us want to rethink 24 // http://codereview.chromium.org/10536066/ make us want to rethink
30 // ownership issues. 25 // ownership issues.
31 // FOR THE MERGE (downstream), re-add derivation from 26 // FOR THE MERGE (downstream), re-add derivation from
32 // base::SupportsWeakPtr<ContentViewCore> to keep everything else working 27 // base::SupportsWeakPtr<ContentViewCore> to keep everything else working
33 // until this issue is resolved. 28 // until this issue is resolved.
34 // http://b/6666045 29 // http://b/6666045
35 class ContentViewCore { 30 class ContentViewCore {
36 public: 31 public:
37 virtual void Destroy(JNIEnv* env, jobject obj) = 0; 32 virtual void Destroy(JNIEnv* env, jobject obj) = 0;
33 virtual content::WebContents* GetWebContents() const = 0;
34 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0;
35 virtual ui::WindowAndroid* GetWindowAndroid() = 0;
38 36
39 static ContentViewCore* Create(JNIEnv* env, jobject obj, 37 static ContentViewCore* Create(
40 WebContents* web_contents); 38 JNIEnv* env, jobject obj, WebContents* web_contents);
41 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); 39 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj);
42 40
43 // --------------------------------------------------------------------------
44 // Methods called from Java via JNI
45 // --------------------------------------------------------------------------
joth 2012/09/24 23:16:27 awesome, thanks for cleaning this up!
46
47 virtual int GetNativeImeAdapter(JNIEnv* env, jobject obj) = 0;
48 virtual void SelectBetweenCoordinates(JNIEnv* env, jobject obj,
49 jint x1, jint y1, jint x2, jint y2) = 0;
50
51 // --------------------------------------------------------------------------
52 // Methods called from native code
53 // --------------------------------------------------------------------------
54
55 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0;
56
57 virtual ui::WindowAndroid* GetWindowAndroid() = 0;
58 protected: 41 protected:
59 virtual ~ContentViewCore() {}; 42 virtual ~ContentViewCore() {};
60 }; 43 };
61 44
62 }; // namespace content 45 }; // namespace content
63 46
64 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_VIEW_CORE_H_ 47 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_
OLDNEW
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698