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

Side by Side Diff: content/browser/android/content_view_impl.h

Issue 10696173: Revert "Revert 146000 - Split out ContentViewCore from ContentView for embedders." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase number deux Created 8 years, 5 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_IMPL_H_
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_IMPL_H_
7
8 #include "base/android/jni_helper.h"
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "base/i18n/rtl.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/process.h"
14 #include "content/public/browser/android/content_view.h"
15 #include "content/public/browser/notification_observer.h"
16 #include "googleurl/src/gurl.h"
17 #include "ui/gfx/rect.h"
18
19 namespace content {
20 class ContentViewClient;
21 class RenderWidgetHostViewAndroid;
22
23 // TODO(jrg): this is a shell. Upstream the rest.
24 class ContentViewImpl : public ContentView,
25 public NotificationObserver {
26 public:
27 ContentViewImpl(JNIEnv* env,
28 jobject obj,
29 WebContents* web_contents);
30 virtual void Destroy(JNIEnv* env, jobject obj);
31
32 // --------------------------------------------------------------------------
33 // Methods called from Java via JNI
34 // --------------------------------------------------------------------------
35
36 void LoadUrlWithoutUrlSanitization(JNIEnv* env,
37 jobject,
38 jstring jurl,
39 int page_transition);
40 void LoadUrlWithoutUrlSanitizationWithUserAgentOverride(
41 JNIEnv* env,
42 jobject,
43 jstring jurl,
44 int page_transition,
45 jstring user_agent_override);
46 base::android::ScopedJavaLocalRef<jstring> GetURL(JNIEnv* env, jobject) const;
47 base::android::ScopedJavaLocalRef<jstring> GetTitle(
48 JNIEnv* env, jobject obj) const;
49 jboolean IsIncognito(JNIEnv* env, jobject obj);
50 jboolean Crashed(JNIEnv* env, jobject obj) const { return tab_crashed_; }
51 jboolean CanGoBack(JNIEnv* env, jobject obj);
52 jboolean CanGoForward(JNIEnv* env, jobject obj);
53 jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset);
54 void GoBack(JNIEnv* env, jobject obj);
55 void GoForward(JNIEnv* env, jobject obj);
56 void GoToOffset(JNIEnv* env, jobject obj, jint offset);
57 jdouble GetLoadProgress(JNIEnv* env, jobject obj) const;
58 void StopLoading(JNIEnv* env, jobject obj);
59 void Reload(JNIEnv* env, jobject obj);
60 jboolean NeedsReload(JNIEnv* env, jobject obj);
61 void ClearHistory(JNIEnv* env, jobject obj);
62 void SetClient(JNIEnv* env, jobject obj, jobject jclient);
63
64 // --------------------------------------------------------------------------
65 // Public methods that call to Java via JNI
66 // --------------------------------------------------------------------------
67
68 void OnTabCrashed(const base::ProcessHandle handle);
69 void SetTitle(const string16& title);
70 bool HasFocus();
71 void OnSelectionChanged(const std::string& text);
72 void OnSelectionBoundsChanged(int startx,
73 int starty,
74 base::i18n::TextDirection start_dir,
75 int endx,
76 int endy,
77 base::i18n::TextDirection end_dir);
78 void OnAcceleratedCompositingStateChange(RenderWidgetHostViewAndroid* rwhva,
79 bool activated,
80 bool force);
81 virtual void StartContentIntent(const GURL& content_url) OVERRIDE;
82
83 // --------------------------------------------------------------------------
84 // Methods called from native code
85 // --------------------------------------------------------------------------
86
87 gfx::Rect GetBounds() const;
88
89 WebContents* web_contents() const { return web_contents_; }
90 void LoadUrl(const GURL& url, int page_transition);
91 void LoadUrlWithUserAgentOverride(
92 const GURL& url,
93 int page_transition,
94 const std::string& user_agent_override);
95
96 private:
97 // NotificationObserver implementation.
98 virtual void Observe(int type,
99 const NotificationSource& source,
100 const NotificationDetails& details) OVERRIDE;
101
102 // --------------------------------------------------------------------------
103 // Private methods that call to Java via JNI
104 // --------------------------------------------------------------------------
105 virtual ~ContentViewImpl();
106
107 // --------------------------------------------------------------------------
108 // Other private methods and data
109 // --------------------------------------------------------------------------
110
111 void InitJNI(JNIEnv* env, jobject obj);
112
113 void PostLoadUrl(const GURL& url);
114
115 struct JavaObject;
116 JavaObject* java_object_;
117
118 // Reference to the current WebContents used to determine how and what to
119 // display in the ContentView.
120 WebContents* web_contents_;
121
122 // We only set this to be the delegate of the web_contents if we own it.
123 scoped_ptr<ContentViewClient> content_view_client_;
124
125 // Whether the renderer backing this ContentView has crashed.
126 bool tab_crashed_;
127
128 DISALLOW_COPY_AND_ASSIGN(ContentViewImpl);
129 };
130
131 bool RegisterContentView(JNIEnv* env);
132
133 }; // namespace content
134
135 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/android/content_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698