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..15ea2077f7f2c2dc9f4842cb5ef79421bcdbfdce 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( |
+ GURL(origin.Serialize()), languages)); |
Yaron
2016/03/09 04:19:59
err, serializing the origin and then creating a GU
Jeffrey Yasskin
2016/03/09 16:40:10
Hm, do we want to be switching to url::Origins eve
palmer
2016/03/09 20:19:39
Ultimately, yes, we want to use url::Origin where
juncai
2016/03/10 00:13:54
Done.
|
java_dialog_.Reset(Java_BluetoothChooserDialog_create( |
env, window_android.obj(), origin_string.obj(), |
security_model_client->GetSecurityInfo().security_level, |