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

Side by Side Diff: chrome/browser/ui/android/bluetooth_chooser_android.cc

Issue 2821973003: bluetooth: Add RSSI icon for bluetooth choosers. (Closed)
Patch Set: #757575 -> @color/google_grey_600 Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/bluetooth_chooser_android.h" 5 #include "chrome/browser/ui/android/bluetooth_chooser_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/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/ssl/security_state_tab_helper.h" 10 #include "chrome/browser/ssl/security_state_tab_helper.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 const base::string16& device_name, 99 const base::string16& device_name,
100 bool is_gatt_connected, 100 bool is_gatt_connected,
101 bool is_paired, 101 bool is_paired,
102 int signal_strength_level) { 102 int signal_strength_level) {
103 JNIEnv* env = AttachCurrentThread(); 103 JNIEnv* env = AttachCurrentThread();
104 ScopedJavaLocalRef<jstring> java_device_id = 104 ScopedJavaLocalRef<jstring> java_device_id =
105 ConvertUTF8ToJavaString(env, device_id); 105 ConvertUTF8ToJavaString(env, device_id);
106 ScopedJavaLocalRef<jstring> java_device_name = 106 ScopedJavaLocalRef<jstring> java_device_name =
107 ConvertUTF16ToJavaString(env, device_name); 107 ConvertUTF16ToJavaString(env, device_name);
108 Java_BluetoothChooserDialog_addOrUpdateDevice( 108 Java_BluetoothChooserDialog_addOrUpdateDevice(
109 env, java_dialog_, java_device_id, java_device_name, is_gatt_connected); 109 env, java_dialog_, java_device_id, java_device_name, is_gatt_connected,
110 signal_strength_level);
110 } 111 }
111 112
112 void BluetoothChooserAndroid::OnDialogFinished( 113 void BluetoothChooserAndroid::OnDialogFinished(
113 JNIEnv* env, 114 JNIEnv* env,
114 const JavaParamRef<jobject>& obj, 115 const JavaParamRef<jobject>& obj,
115 jint event_type, 116 jint event_type,
116 const JavaParamRef<jstring>& device_id) { 117 const JavaParamRef<jstring>& device_id) {
117 // Values are defined in BluetoothChooserDialog as DIALOG_FINISHED constants. 118 // Values are defined in BluetoothChooserDialog as DIALOG_FINISHED constants.
118 switch (event_type) { 119 switch (event_type) {
119 case 0: 120 case 0:
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // static 165 // static
165 bool BluetoothChooserAndroid::Register(JNIEnv* env) { 166 bool BluetoothChooserAndroid::Register(JNIEnv* env) {
166 return RegisterNativesImpl(env); 167 return RegisterNativesImpl(env);
167 } 168 }
168 169
169 void BluetoothChooserAndroid::OpenURL(const char* url) { 170 void BluetoothChooserAndroid::OpenURL(const char* url) {
170 web_contents_->OpenURL(content::OpenURLParams( 171 web_contents_->OpenURL(content::OpenURLParams(
171 GURL(url), content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, 172 GURL(url), content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB,
172 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initiated */)); 173 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initiated */));
173 } 174 }
OLDNEW
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698