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

Unified Diff: chrome/browser/ui/android/javascript_app_modal_dialog_android.h

Issue 10823340: [Android] Upstream Modal Dialogs functionality (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove webview code 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: chrome/browser/ui/android/javascript_app_modal_dialog_android.h
diff --git a/chrome/browser/ui/android/javascript_app_modal_dialog_android.h b/chrome/browser/ui/android/javascript_app_modal_dialog_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..3e4c8fca60c4a701de43c3a5ae0b49823f591d52
--- /dev/null
+++ b/chrome/browser/ui/android/javascript_app_modal_dialog_android.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_ANDROID_JAVASCRIPT_APP_MODAL_DIALOG_ANDROID_H_
+#define CHROME_BROWSER_UI_ANDROID_JAVASCRIPT_APP_MODAL_DIALOG_ANDROID_H_
+
+#include "base/android/jni_helper.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h"
+
+class JavaScriptAppModalDialog;
+
+class JavascriptAppModalDialogAndroid : public NativeAppModalDialog {
+ public:
+ JavascriptAppModalDialogAndroid(JNIEnv* env,
+ JavaScriptAppModalDialog* dialog,
+ gfx::NativeWindow parent);
+ virtual ~JavascriptAppModalDialogAndroid();
+
+ // NativeAppModalDialog:
+ virtual int GetAppModalDialogButtons() const OVERRIDE;
+ virtual void ShowAppModalDialog() OVERRIDE;
+ virtual void ActivateAppModalDialog() OVERRIDE;
+ virtual void CloseAppModalDialog() OVERRIDE;
+ virtual void AcceptAppModalDialog() OVERRIDE;
+ virtual void CancelAppModalDialog() OVERRIDE;
+
+ // Called when java confirms or cancels the dialog.
+ void DidAcceptAppModalDialog(JNIEnv* env,
+ jobject obj,
+ jstring prompt_text,
+ bool suppress_js_dialogs);
+ void DidCancelAppModalDialog(JNIEnv* env, jobject, bool suppress_js_dialogs);
+
+ static bool RegisterJavascriptAppModalDialog(JNIEnv* env);
+
+ private:
+ scoped_ptr<JavaScriptAppModalDialog> dialog_;
+ base::android::ScopedJavaGlobalRef<jobject> dialog_jobject_;
+ JavaObjectWeakGlobalRef parent_jobject_weak_ref;
+
+ DISALLOW_COPY_AND_ASSIGN(JavascriptAppModalDialogAndroid);
+};
+
+
+#endif // CHROME_BROWSER_UI_ANDROID_JAVASCRIPT_APP_MODAL_DIALOG_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698