Index: chrome/browser/ui/android/bluetooth_chooser_android.cc |
diff --git a/chrome/browser/ui/android/bluetooth_chooser_android.cc b/chrome/browser/ui/android/bluetooth_chooser_android.cc |
index 5631e6428dd5f61655a75cd3d2bc0b0625f92e41..a24ef89fe9daa0832d1234d220946286ddad3562 100644 |
--- a/chrome/browser/ui/android/bluetooth_chooser_android.cc |
+++ b/chrome/browser/ui/android/bluetooth_chooser_android.cc |
@@ -7,13 +7,18 @@ |
#include "base/android/jni_android.h" |
#include "base/android/jni_string.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ssl/chrome_security_state_model_client.h" |
#include "chrome/browser/ui/android/view_android_helper.h" |
+#include "chrome/common/pref_names.h" |
#include "chrome/common/url_constants.h" |
+#include "components/prefs/pref_service.h" |
+#include "components/url_formatter/elide_url.h" |
#include "content/public/browser/android/content_view_core.h" |
#include "content/public/browser/render_frame_host.h" |
#include "jni/BluetoothChooserDialog_jni.h" |
#include "ui/android/window_android.h" |
+#include "url/gurl.h" |
#include "url/origin.h" |
using base::android::AttachCurrentThread; |
@@ -40,8 +45,14 @@ BluetoothChooserAndroid::BluetoothChooserAndroid( |
// Create (and show) the BluetoothChooser dialog. |
JNIEnv* env = AttachCurrentThread(); |
- ScopedJavaLocalRef<jstring> origin_string = |
- ConvertUTF8ToJavaString(env, origin.Serialize()); |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
+ std::string languages = |
+ profile->GetPrefs()->GetString(prefs::kAcceptLanguages); |
+ base::android::ScopedJavaLocalRef<jstring> origin_string = |
+ base::android::ConvertUTF16ToJavaString( |
+ env, url_formatter::FormatUrlForSecurityDisplay( |
+ frame->GetLastCommittedURL(), languages)); |
java_dialog_.Reset(Java_BluetoothChooserDialog_create( |
env, window_android.obj(), origin_string.obj(), |
security_model_client->GetSecurityInfo().security_level, |