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

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

Issue 2753613002: Remove content::BluetoothChooser::RemoveDevice() function (Closed)
Patch Set: remove content::BluetoothChooser::RemoveDevice() function Created 3 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 unified diff | Download patch
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 109 env, java_dialog_, java_device_id, java_device_name);
110 } 110 }
111 111
112 void BluetoothChooserAndroid::RemoveDevice(const std::string& device_id) {
113 JNIEnv* env = AttachCurrentThread();
114 ScopedJavaLocalRef<jstring> java_device_id =
115 ConvertUTF16ToJavaString(env, base::UTF8ToUTF16(device_id));
116 Java_BluetoothChooserDialog_removeDevice(env, java_dialog_, java_device_id);
117 }
118
119 void BluetoothChooserAndroid::OnDialogFinished( 112 void BluetoothChooserAndroid::OnDialogFinished(
120 JNIEnv* env, 113 JNIEnv* env,
121 const JavaParamRef<jobject>& obj, 114 const JavaParamRef<jobject>& obj,
122 jint event_type, 115 jint event_type,
123 const JavaParamRef<jstring>& device_id) { 116 const JavaParamRef<jstring>& device_id) {
124 // Values are defined in BluetoothChooserDialog as DIALOG_FINISHED constants. 117 // Values are defined in BluetoothChooserDialog as DIALOG_FINISHED constants.
125 switch (event_type) { 118 switch (event_type) {
126 case 0: 119 case 0:
127 event_handler_.Run(Event::DENIED_PERMISSION, ""); 120 event_handler_.Run(Event::DENIED_PERMISSION, "");
128 return; 121 return;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // static 164 // static
172 bool BluetoothChooserAndroid::Register(JNIEnv* env) { 165 bool BluetoothChooserAndroid::Register(JNIEnv* env) {
173 return RegisterNativesImpl(env); 166 return RegisterNativesImpl(env);
174 } 167 }
175 168
176 void BluetoothChooserAndroid::OpenURL(const char* url) { 169 void BluetoothChooserAndroid::OpenURL(const char* url) {
177 web_contents_->OpenURL(content::OpenURLParams( 170 web_contents_->OpenURL(content::OpenURLParams(
178 GURL(url), content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, 171 GURL(url), content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB,
179 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initiated */)); 172 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initiated */));
180 } 173 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/bluetooth_chooser_android.h ('k') | chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698