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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_IMPL_H_ | 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
7 | 7 |
8 #include "base/android/jni_helper.h" | 8 #include "base/android/jni_helper.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/process.h" | 13 #include "base/process.h" |
14 #include "content/public/browser/android/content_view.h" | 14 #include "content/public/browser/android/content_view_core.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class ContentViewClient; | 20 class ContentViewClient; |
21 class RenderWidgetHostViewAndroid; | 21 class RenderWidgetHostViewAndroid; |
22 | 22 |
23 // TODO(jrg): this is a shell. Upstream the rest. | 23 // TODO(jrg): this is a shell. Upstream the rest. |
24 class ContentViewImpl : public ContentView, | 24 class ContentViewCoreImpl : public ContentViewCore, |
25 public NotificationObserver { | 25 public NotificationObserver { |
26 public: | 26 public: |
27 ContentViewImpl(JNIEnv* env, | 27 ContentViewCoreImpl(JNIEnv* env, |
28 jobject obj, | 28 jobject obj, |
29 WebContents* web_contents); | 29 WebContents* web_contents); |
30 virtual void Destroy(JNIEnv* env, jobject obj); | 30 virtual void Destroy(JNIEnv* env, jobject obj); |
31 | 31 |
32 // -------------------------------------------------------------------------- | 32 // -------------------------------------------------------------------------- |
33 // Methods called from Java via JNI | 33 // Methods called from Java via JNI |
34 // -------------------------------------------------------------------------- | 34 // -------------------------------------------------------------------------- |
35 | 35 |
36 void LoadUrlWithoutUrlSanitization(JNIEnv* env, | 36 void LoadUrlWithoutUrlSanitization(JNIEnv* env, |
37 jobject, | 37 jobject, |
38 jstring jurl, | 38 jstring jurl, |
39 int page_transition); | 39 int page_transition); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 private: | 96 private: |
97 // NotificationObserver implementation. | 97 // NotificationObserver implementation. |
98 virtual void Observe(int type, | 98 virtual void Observe(int type, |
99 const NotificationSource& source, | 99 const NotificationSource& source, |
100 const NotificationDetails& details) OVERRIDE; | 100 const NotificationDetails& details) OVERRIDE; |
101 | 101 |
102 // -------------------------------------------------------------------------- | 102 // -------------------------------------------------------------------------- |
103 // Private methods that call to Java via JNI | 103 // Private methods that call to Java via JNI |
104 // -------------------------------------------------------------------------- | 104 // -------------------------------------------------------------------------- |
105 virtual ~ContentViewImpl(); | 105 virtual ~ContentViewCoreImpl(); |
106 | 106 |
107 // -------------------------------------------------------------------------- | 107 // -------------------------------------------------------------------------- |
108 // Other private methods and data | 108 // Other private methods and data |
109 // -------------------------------------------------------------------------- | 109 // -------------------------------------------------------------------------- |
110 | 110 |
111 void InitJNI(JNIEnv* env, jobject obj); | 111 void InitJNI(JNIEnv* env, jobject obj); |
112 | 112 |
113 void PostLoadUrl(const GURL& url); | 113 void PostLoadUrl(const GURL& url); |
114 | 114 |
115 struct JavaObject; | 115 struct JavaObject; |
116 JavaObject* java_object_; | 116 JavaObject* java_object_; |
117 | 117 |
118 // Reference to the current WebContents used to determine how and what to | 118 // Reference to the current WebContents used to determine how and what to |
119 // display in the ContentView. | 119 // display in the ContentViewCore. |
120 WebContents* web_contents_; | 120 WebContents* web_contents_; |
121 | 121 |
122 // We only set this to be the delegate of the web_contents if we own it. | 122 // We only set this to be the delegate of the web_contents if we own it. |
123 scoped_ptr<ContentViewClient> content_view_client_; | 123 scoped_ptr<ContentViewClient> content_view_client_; |
124 | 124 |
125 // Whether the renderer backing this ContentView has crashed. | 125 // Whether the renderer backing this ContentViewCore has crashed. |
126 bool tab_crashed_; | 126 bool tab_crashed_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(ContentViewImpl); | 128 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
129 }; | 129 }; |
130 | 130 |
131 bool RegisterContentView(JNIEnv* env); | 131 bool RegisterContentViewCore(JNIEnv* env); |
132 | 132 |
133 }; // namespace content | 133 }; // namespace content |
134 | 134 |
135 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_IMPL_H_ | 135 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |