| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/android/tab_web_contents_delegate_android.h" | 5 #include "chrome/browser/android/tab_web_contents_delegate_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 WebContents* new_contents, | 382 WebContents* new_contents, |
| 383 WindowOpenDisposition disposition, | 383 WindowOpenDisposition disposition, |
| 384 const gfx::Rect& initial_rect, | 384 const gfx::Rect& initial_rect, |
| 385 bool user_gesture, | 385 bool user_gesture, |
| 386 bool* was_blocked) { | 386 bool* was_blocked) { |
| 387 // No code for this yet. | 387 // No code for this yet. |
| 388 DCHECK_NE(disposition, WindowOpenDisposition::SAVE_TO_DISK); | 388 DCHECK_NE(disposition, WindowOpenDisposition::SAVE_TO_DISK); |
| 389 // Can't create a new contents for the current tab - invalid case. | 389 // Can't create a new contents for the current tab - invalid case. |
| 390 DCHECK_NE(disposition, WindowOpenDisposition::CURRENT_TAB); | 390 DCHECK_NE(disposition, WindowOpenDisposition::CURRENT_TAB); |
| 391 | 391 |
| 392 TabHelpers::AttachTabHelpers(new_contents); | 392 TabHelpers::AttachTabHelpers(new_contents, base::nullopt); |
| 393 | 393 |
| 394 JNIEnv* env = AttachCurrentThread(); | 394 JNIEnv* env = AttachCurrentThread(); |
| 395 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 395 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 396 bool handled = false; | 396 bool handled = false; |
| 397 if (!obj.is_null()) { | 397 if (!obj.is_null()) { |
| 398 ScopedJavaLocalRef<jobject> jsource; | 398 ScopedJavaLocalRef<jobject> jsource; |
| 399 if (source) | 399 if (source) |
| 400 jsource = source->GetJavaWebContents(); | 400 jsource = source->GetJavaWebContents(); |
| 401 ScopedJavaLocalRef<jobject> jnew_contents; | 401 ScopedJavaLocalRef<jobject> jnew_contents; |
| 402 if (new_contents) | 402 if (new_contents) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 void NotifyStopped(JNIEnv* env, | 494 void NotifyStopped(JNIEnv* env, |
| 495 const JavaParamRef<jclass>& clazz, | 495 const JavaParamRef<jclass>& clazz, |
| 496 const JavaParamRef<jobject>& java_web_contents) { | 496 const JavaParamRef<jobject>& java_web_contents) { |
| 497 content::WebContents* web_contents = | 497 content::WebContents* web_contents = |
| 498 content::WebContents::FromJavaWebContents(java_web_contents); | 498 content::WebContents::FromJavaWebContents(java_web_contents); |
| 499 scoped_refptr<MediaStreamCaptureIndicator> indicator = | 499 scoped_refptr<MediaStreamCaptureIndicator> indicator = |
| 500 MediaCaptureDevicesDispatcher::GetInstance() | 500 MediaCaptureDevicesDispatcher::GetInstance() |
| 501 ->GetMediaStreamCaptureIndicator(); | 501 ->GetMediaStreamCaptureIndicator(); |
| 502 indicator->NotifyStopped(web_contents); | 502 indicator->NotifyStopped(web_contents); |
| 503 } | 503 } |
| OLD | NEW |