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

Unified Diff: content/public/browser/android/content_view_core.h

Issue 10823340: [Android] Upstream Modal Dialogs functionality (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/android/content_view_core.h
diff --git a/content/public/browser/android/content_view_core.h b/content/public/browser/android/content_view_core.h
index a1871963e26520c193f0b729e39d629fe475473f..30d81ff417a2c5f31060f225e3709a5b0b02fa15 100644
--- a/content/public/browser/android/content_view_core.h
+++ b/content/public/browser/android/content_view_core.h
@@ -18,15 +18,6 @@ class WebContents;
// public interface used by native code outside of the content module.
//
// TODO(jrg): this is a shell. Upstream the rest.
-//
-// TODO(jrg): downstream, this class derives from
-// base::SupportsWeakPtr<ContentViewCore>. Issues raised in
-// http://codereview.chromium.org/10536066/ make us want to rethink
-// ownership issues.
-// FOR THE MERGE (downstream), re-add derivation from
-// base::SupportsWeakPtr<ContentViewCore> to keep everything else working
-// until this issue is resolved.
-// http://b/6666045
class ContentViewCore {
public:
virtual void Destroy(JNIEnv* env, jobject obj) = 0;
@@ -35,6 +26,21 @@ class ContentViewCore {
WebContents* web_contents);
static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj);
+ // Convenience methods for retrieving the ContentViewCore associated with a
+ // WebContents. Can return NULL.
+ static ContentViewCore* FromWebContents(content::WebContents* web_contents);
+
+ virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0;
+
+ // Offer handling of a JS dialog to the content view client. Returns false
+ // if the client will handle the dialog, or true if we should use the
+ // default handling - i.e. popping up a dialog box.
+ virtual bool ShouldUseNativeJsModalDialog(
+ content::JavaScriptMessageType type,
+ bool is_before_unload_dialog,
+ const string16& message,
+ const string16& default_value,
+ jobject js_result) = 0;
protected:
virtual ~ContentViewCore() {};
};

Powered by Google App Engine
This is Rietveld 408576698