| OLD | NEW |
| 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 12 matching lines...) Expand all Loading... |
| 23 using base::android::ConvertUTF16ToJavaString; | 23 using base::android::ConvertUTF16ToJavaString; |
| 24 using base::android::JavaParamRef; | 24 using base::android::JavaParamRef; |
| 25 using base::android::ScopedJavaLocalRef; | 25 using base::android::ScopedJavaLocalRef; |
| 26 | 26 |
| 27 BluetoothChooserAndroid::BluetoothChooserAndroid( | 27 BluetoothChooserAndroid::BluetoothChooserAndroid( |
| 28 content::RenderFrameHost* frame, | 28 content::RenderFrameHost* frame, |
| 29 const EventHandler& event_handler) | 29 const EventHandler& event_handler) |
| 30 : web_contents_(content::WebContents::FromRenderFrameHost(frame)), | 30 : web_contents_(content::WebContents::FromRenderFrameHost(frame)), |
| 31 event_handler_(event_handler) { | 31 event_handler_(event_handler) { |
| 32 const url::Origin origin = frame->GetLastCommittedOrigin(); | 32 const url::Origin origin = frame->GetLastCommittedOrigin(); |
| 33 DCHECK(!origin.unique()); | 33 DCHECK(!origin.opaque()); |
| 34 | 34 |
| 35 base::android::ScopedJavaLocalRef<jobject> window_android = | 35 base::android::ScopedJavaLocalRef<jobject> window_android = |
| 36 content::ContentViewCore::FromWebContents(web_contents_) | 36 content::ContentViewCore::FromWebContents(web_contents_) |
| 37 ->GetWindowAndroid() | 37 ->GetWindowAndroid() |
| 38 ->GetJavaObject(); | 38 ->GetJavaObject(); |
| 39 | 39 |
| 40 SecurityStateTabHelper* helper = | 40 SecurityStateTabHelper* helper = |
| 41 SecurityStateTabHelper::FromWebContents(web_contents_); | 41 SecurityStateTabHelper::FromWebContents(web_contents_); |
| 42 DCHECK(helper); | 42 DCHECK(helper); |
| 43 | 43 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // static | 171 // static |
| 172 bool BluetoothChooserAndroid::Register(JNIEnv* env) { | 172 bool BluetoothChooserAndroid::Register(JNIEnv* env) { |
| 173 return RegisterNativesImpl(env); | 173 return RegisterNativesImpl(env); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void BluetoothChooserAndroid::OpenURL(const char* url) { | 176 void BluetoothChooserAndroid::OpenURL(const char* url) { |
| 177 web_contents_->OpenURL(content::OpenURLParams( | 177 web_contents_->OpenURL(content::OpenURLParams( |
| 178 GURL(url), content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, | 178 GURL(url), content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 179 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initiated */)); | 179 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initiated */)); |
| 180 } | 180 } |
| OLD | NEW |