| 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 #include "chrome/browser/ui/android/javascript_app_modal_dialog_android.h" | 5 #include "chrome/browser/ui/android/javascript_app_modal_dialog_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 | 10 |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h" | 12 #include "chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h" |
| 13 #include "content/public/browser/android/content_view_core.h" | |
| 14 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 16 #include "content/public/common/javascript_message_type.h" | 15 #include "content/public/common/javascript_message_type.h" |
| 17 #include "jni/JavascriptAppModalDialog_jni.h" | 16 #include "jni/JavascriptAppModalDialog_jni.h" |
| 17 #include "ui/gfx/android/window_android.h" |
| 18 | 18 |
| 19 using base::android::AttachCurrentThread; | 19 using base::android::AttachCurrentThread; |
| 20 using base::android::ConvertUTF16ToJavaString; | 20 using base::android::ConvertUTF16ToJavaString; |
| 21 using base::android::ScopedJavaLocalRef; | 21 using base::android::ScopedJavaLocalRef; |
| 22 using content::BrowserThread; | 22 using content::BrowserThread; |
| 23 using content::ContentViewCore; | |
| 24 | 23 |
| 25 // static | 24 // static |
| 26 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( | 25 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( |
| 27 JavaScriptAppModalDialog* dialog, | 26 JavaScriptAppModalDialog* dialog, |
| 28 gfx::NativeWindow parent_window) { | 27 gfx::NativeWindow parent_window) { |
| 29 return new JavascriptAppModalDialogAndroid(AttachCurrentThread(), | 28 return new JavascriptAppModalDialogAndroid(AttachCurrentThread(), |
| 30 dialog, parent_window); | 29 dialog, parent_window); |
| 31 } | 30 } |
| 32 | 31 |
| 33 JavascriptAppModalDialogAndroid::JavascriptAppModalDialogAndroid( | 32 JavascriptAppModalDialogAndroid::JavascriptAppModalDialogAndroid( |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 JNIEnv* env, jobject, bool should_suppress_js_dialogs) { | 139 JNIEnv* env, jobject, bool should_suppress_js_dialogs) { |
| 141 dialog_->OnCancel(should_suppress_js_dialogs); | 140 dialog_->OnCancel(should_suppress_js_dialogs); |
| 142 delete this; | 141 delete this; |
| 143 } | 142 } |
| 144 | 143 |
| 145 // static | 144 // static |
| 146 bool JavascriptAppModalDialogAndroid::RegisterJavascriptAppModalDialog( | 145 bool JavascriptAppModalDialogAndroid::RegisterJavascriptAppModalDialog( |
| 147 JNIEnv* env) { | 146 JNIEnv* env) { |
| 148 return RegisterNativesImpl(env); | 147 return RegisterNativesImpl(env); |
| 149 } | 148 } |
| OLD | NEW |