OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chrome_web_contents_delegate_android.h" | 5 #include "chrome/browser/android/chrome_web_contents_delegate_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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/browser/android/feature_utilities.h" | 10 #include "chrome/browser/android/feature_utilities.h" |
11 #include "chrome/browser/android/hung_renderer_infobar_delegate.h" | 11 #include "chrome/browser/android/hung_renderer_infobar_delegate.h" |
12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
13 #include "chrome/browser/file_select_helper.h" | 13 #include "chrome/browser/file_select_helper.h" |
14 #include "chrome/browser/infobars/infobar_service.h" | 14 #include "chrome/browser/infobars/infobar_service.h" |
15 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 15 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
16 #include "chrome/browser/media/media_stream_capture_indicator.h" | 16 #include "chrome/browser/media/media_stream_capture_indicator.h" |
17 #include "chrome/browser/media/protected_media_identifier_permission_context.h" | 17 #include "chrome/browser/media/protected_media_identifier_permission_context.h" |
18 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" | 18 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" |
19 #include "chrome/browser/prerender/prerender_manager.h" | 19 #include "chrome/browser/prerender/prerender_manager.h" |
20 #include "chrome/browser/prerender/prerender_manager_factory.h" | 20 #include "chrome/browser/prerender/prerender_manager_factory.h" |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/ui/android/bluetooth_chooser_android.h" | 22 #include "chrome/browser/ui/android/bluetooth_chooser_android.h" |
23 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 23 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
24 #include "chrome/browser/ui/browser_navigator.h" | |
25 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 24 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
26 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 25 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
27 #include "chrome/browser/ui/tab_helpers.h" | 26 #include "chrome/browser/ui/tab_helpers.h" |
28 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
29 #include "components/app_modal/javascript_dialog_manager.h" | 28 #include "components/app_modal/javascript_dialog_manager.h" |
30 #include "components/infobars/core/infobar.h" | 29 #include "components/infobars/core/infobar.h" |
31 #include "content/public/browser/notification_details.h" | 30 #include "content/public/browser/notification_details.h" |
32 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
33 #include "content/public/browser/notification_source.h" | 32 #include "content/public/browser/notification_source.h" |
34 #include "content/public/browser/render_process_host.h" | 33 #include "content/public/browser/render_process_host.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 blink::WebDisplayMode ChromeWebContentsDelegateAndroid::GetDisplayMode( | 159 blink::WebDisplayMode ChromeWebContentsDelegateAndroid::GetDisplayMode( |
161 const WebContents* web_contents) const { | 160 const WebContents* web_contents) const { |
162 JNIEnv* env = base::android::AttachCurrentThread(); | 161 JNIEnv* env = base::android::AttachCurrentThread(); |
163 | 162 |
164 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 163 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
165 if (obj.is_null()) | 164 if (obj.is_null()) |
166 return blink::WebDisplayModeUndefined; | 165 return blink::WebDisplayModeUndefined; |
167 | 166 |
168 return static_cast<blink::WebDisplayMode>( | 167 return static_cast<blink::WebDisplayMode>( |
169 Java_ChromeWebContentsDelegateAndroid_getDisplayMode( | 168 Java_ChromeWebContentsDelegateAndroid_getDisplayMode( |
170 env, obj.obj()) | 169 env, obj.obj())); |
171 ); | |
172 } | 170 } |
173 | 171 |
174 void ChromeWebContentsDelegateAndroid::FindReply( | 172 void ChromeWebContentsDelegateAndroid::FindReply( |
175 WebContents* web_contents, | 173 WebContents* web_contents, |
176 int request_id, | 174 int request_id, |
177 int number_of_matches, | 175 int number_of_matches, |
178 const gfx::Rect& selection_rect, | 176 const gfx::Rect& selection_rect, |
179 int active_match_ordinal, | 177 int active_match_ordinal, |
180 bool final_update) { | 178 bool final_update) { |
181 if (!notification_registrar_.IsRegistered(this, | 179 if (!notification_registrar_.IsRegistered(this, |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 jboolean IsCapturingVideo(JNIEnv* env, | 441 jboolean IsCapturingVideo(JNIEnv* env, |
444 const JavaParamRef<jclass>& clazz, | 442 const JavaParamRef<jclass>& clazz, |
445 const JavaParamRef<jobject>& java_web_contents) { | 443 const JavaParamRef<jobject>& java_web_contents) { |
446 content::WebContents* web_contents = | 444 content::WebContents* web_contents = |
447 content::WebContents::FromJavaWebContents(java_web_contents); | 445 content::WebContents::FromJavaWebContents(java_web_contents); |
448 scoped_refptr<MediaStreamCaptureIndicator> indicator = | 446 scoped_refptr<MediaStreamCaptureIndicator> indicator = |
449 MediaCaptureDevicesDispatcher::GetInstance()-> | 447 MediaCaptureDevicesDispatcher::GetInstance()-> |
450 GetMediaStreamCaptureIndicator(); | 448 GetMediaStreamCaptureIndicator(); |
451 return indicator->IsCapturingVideo(web_contents); | 449 return indicator->IsCapturingVideo(web_contents); |
452 } | 450 } |
OLD | NEW |