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

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

Issue 10704049: Split out ContentViewCore from ContentView for embedders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 #pragma once
8
9 #include "base/android/jni_helper.h"
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/i18n/rtl.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/process.h"
15 #include "content/public/browser/android/content_view.h"
16 #include "content/public/browser/notification_observer.h"
17 #include "googleurl/src/gurl.h"
18 #include "ui/gfx/rect.h"
19
20 namespace content {
21 class ContentViewClient;
22 class RenderWidgetHostViewAndroid;
23
24 // TODO(jrg): this is a shell. Upstream the rest.
25 class ContentViewImpl : public ContentView,
26 public NotificationObserver {
27 public:
28 ContentViewImpl(JNIEnv* env,
29 jobject obj,
30 WebContents* web_contents);
31 virtual void Destroy(JNIEnv* env, jobject obj);
32
33 // --------------------------------------------------------------------------
34 // Methods called from Java via JNI
35 // --------------------------------------------------------------------------
36
37 void LoadUrlWithoutUrlSanitization(JNIEnv* env,
38 jobject,
39 jstring jurl,
40 int page_transition);
41 void LoadUrlWithoutUrlSanitizationWithUserAgentOverride(
42 JNIEnv* env,
43 jobject,
44 jstring jurl,
45 int page_transition,
46 jstring user_agent_override);
47 base::android::ScopedJavaLocalRef<jstring> GetURL(JNIEnv* env, jobject) const;
48 base::android::ScopedJavaLocalRef<jstring> GetTitle(
49 JNIEnv* env, jobject obj) const;
50 jboolean IsIncognito(JNIEnv* env, jobject obj);
51 jboolean Crashed(JNIEnv* env, jobject obj) const { return tab_crashed_; }
52 jboolean CanGoBack(JNIEnv* env, jobject obj);
53 jboolean CanGoForward(JNIEnv* env, jobject obj);
54 jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset);
55 void GoBack(JNIEnv* env, jobject obj);
56 void GoForward(JNIEnv* env, jobject obj);
57 void GoToOffset(JNIEnv* env, jobject obj, jint offset);
58 jdouble GetLoadProgress(JNIEnv* env, jobject obj) const;
59 void StopLoading(JNIEnv* env, jobject obj);
60 void Reload(JNIEnv* env, jobject obj);
61 jboolean NeedsReload(JNIEnv* env, jobject obj);
62 void ClearHistory(JNIEnv* env, jobject obj);
63 void SetClient(JNIEnv* env, jobject obj, jobject jclient);
64
65 // --------------------------------------------------------------------------
66 // Public methods that call to Java via JNI
67 // --------------------------------------------------------------------------
68
69 void OnTabCrashed(const base::ProcessHandle handle);
70 void SetTitle(const string16& title);
71 bool HasFocus();
72 void OnSelectionChanged(const std::string& text);
73 void OnSelectionBoundsChanged(int startx,
74 int starty,
75 base::i18n::TextDirection start_dir,
76 int endx,
77 int endy,
78 base::i18n::TextDirection end_dir);
79 void OnAcceleratedCompositingStateChange(RenderWidgetHostViewAndroid* rwhva,
80 bool activated,
81 bool force);
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 PostLoadUrl(const GURL& url);
112
113 // Reference to the current WebContents used to determine how and what to
114 // display in the ContentView.
115 WebContents* web_contents_;
116
117 // We only set this to be the delegate of the web_contents if we own it.
118 scoped_ptr<ContentViewClient> content_view_client_;
119
120 // Whether the renderer backing this ContentView has crashed.
121 bool tab_crashed_;
122
123 DISALLOW_COPY_AND_ASSIGN(ContentViewImpl);
124 };
125
126 bool RegisterContentView(JNIEnv* env);
127
128 }; // namespace content
129
130 #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