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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 158 } |
159 } | 159 } |
160 return false; | 160 return false; |
161 } | 161 } |
162 | 162 |
163 | 163 |
164 void TabWebContentsDelegateAndroid::Observe( | 164 void TabWebContentsDelegateAndroid::Observe( |
165 int type, | 165 int type, |
166 const content::NotificationSource& source, | 166 const content::NotificationSource& source, |
167 const content::NotificationDetails& details) { | 167 const content::NotificationDetails& details) { |
168 switch (type) { | 168 DCHECK_EQ(chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, type); |
169 case chrome::NOTIFICATION_FIND_RESULT_AVAILABLE: | 169 OnFindResultAvailable( |
170 OnFindResultAvailable( | 170 content::Source<WebContents>(source).ptr(), |
171 content::Source<WebContents>(source).ptr(), | 171 content::Details<FindNotificationDetails>(details).ptr()); |
172 content::Details<FindNotificationDetails>(details).ptr()); | |
173 break; | |
174 default: | |
175 NOTREACHED() << "Unexpected notification: " << type; | |
176 break; | |
177 } | |
178 } | 172 } |
179 | 173 |
180 blink::WebDisplayMode TabWebContentsDelegateAndroid::GetDisplayMode( | 174 blink::WebDisplayMode TabWebContentsDelegateAndroid::GetDisplayMode( |
181 const WebContents* web_contents) const { | 175 const WebContents* web_contents) const { |
182 JNIEnv* env = base::android::AttachCurrentThread(); | 176 JNIEnv* env = base::android::AttachCurrentThread(); |
183 | 177 |
184 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 178 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
185 if (obj.is_null()) | 179 if (obj.is_null()) |
186 return blink::WebDisplayModeUndefined; | 180 return blink::WebDisplayModeUndefined; |
187 | 181 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 jboolean IsCapturingVideo(JNIEnv* env, | 476 jboolean IsCapturingVideo(JNIEnv* env, |
483 const JavaParamRef<jclass>& clazz, | 477 const JavaParamRef<jclass>& clazz, |
484 const JavaParamRef<jobject>& java_web_contents) { | 478 const JavaParamRef<jobject>& java_web_contents) { |
485 content::WebContents* web_contents = | 479 content::WebContents* web_contents = |
486 content::WebContents::FromJavaWebContents(java_web_contents); | 480 content::WebContents::FromJavaWebContents(java_web_contents); |
487 scoped_refptr<MediaStreamCaptureIndicator> indicator = | 481 scoped_refptr<MediaStreamCaptureIndicator> indicator = |
488 MediaCaptureDevicesDispatcher::GetInstance()-> | 482 MediaCaptureDevicesDispatcher::GetInstance()-> |
489 GetMediaStreamCaptureIndicator(); | 483 GetMediaStreamCaptureIndicator(); |
490 return indicator->IsCapturingVideo(web_contents); | 484 return indicator->IsCapturingVideo(web_contents); |
491 } | 485 } |
OLD | NEW |