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

Unified Diff: android_webview/native/aw_contents_client_bridge.cc

Issue 1714573002: Remove the ability of webpages to specify strings for the onbeforeunload dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 4 years, 9 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
« no previous file with comments | « android_webview/native/aw_contents_client_bridge.h ('k') | android_webview/native/webview_native.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents_client_bridge.cc
diff --git a/android_webview/native/aw_contents_client_bridge.cc b/android_webview/native/aw_contents_client_bridge.cc
index 4d2fd4dcb7d10282a76af0b20863f8625f5b70f3..d5b3b4457b2e413bbace5ea7b6d4c3f80863b778 100644
--- a/android_webview/native/aw_contents_client_bridge.cc
+++ b/android_webview/native/aw_contents_client_bridge.cc
@@ -17,12 +17,14 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "crypto/scoped_openssl_types.h"
+#include "grit/components_strings.h"
#include "jni/AwContentsClientBridge_jni.h"
#include "net/android/keystore_openssl.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/openssl_client_key_store.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/ssl/ssl_client_cert_type.h"
+#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
using base::android::AttachCurrentThread;
@@ -318,7 +320,6 @@ void AwContentsClientBridge::RunJavaScriptDialog(
void AwContentsClientBridge::RunBeforeUnloadDialog(
const GURL& origin_url,
- const base::string16& message_text,
const content::JavaScriptDialogManager::DialogClosedCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
JNIEnv* env = AttachCurrentThread();
@@ -329,6 +330,9 @@ void AwContentsClientBridge::RunBeforeUnloadDialog(
return;
}
+ const base::string16 message_text =
+ l10n_util::GetStringUTF16(IDS_BEFOREUNLOAD_MESSAGEBOX_MESSAGE);
+
int callback_id = pending_js_dialog_callbacks_.Add(
new content::JavaScriptDialogManager::DialogClosedCallback(callback));
ScopedJavaLocalRef<jstring> jurl(
« no previous file with comments | « android_webview/native/aw_contents_client_bridge.h ('k') | android_webview/native/webview_native.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698