| 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" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "chrome/browser/android/banners/app_banner_manager_android.h" | 13 #include "chrome/browser/android/banners/app_banner_manager_android.h" |
| 14 #include "chrome/browser/android/feature_utilities.h" | 14 #include "chrome/browser/android/feature_utilities.h" |
| 15 #include "chrome/browser/android/hung_renderer_infobar_delegate.h" | 15 #include "chrome/browser/android/hung_renderer_infobar_delegate.h" |
| 16 | |
| 17 #include "device/vr/features/features.h" | |
| 18 #if BUILDFLAG(ENABLE_VR) | |
| 19 #include "chrome/browser/android/vr_shell/vr_tab_helper.h" | |
| 20 #endif // BUILDFLAG(ENABLE_VR) | |
| 21 | |
| 22 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
| 23 #include "chrome/browser/file_select_helper.h" | 17 #include "chrome/browser/file_select_helper.h" |
| 24 #include "chrome/browser/infobars/infobar_service.h" | 18 #include "chrome/browser/infobars/infobar_service.h" |
| 25 #include "chrome/browser/media/protected_media_identifier_permission_context.h" | 19 #include "chrome/browser/media/protected_media_identifier_permission_context.h" |
| 26 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" | 20 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
| 27 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" | 21 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" |
| 28 #include "chrome/browser/prerender/prerender_manager.h" | 22 #include "chrome/browser/prerender/prerender_manager.h" |
| 29 #include "chrome/browser/prerender/prerender_manager_factory.h" | 23 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 30 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/browser/ui/android/bluetooth_chooser_android.h" | 25 #include "chrome/browser/ui/android/bluetooth_chooser_android.h" |
| 32 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 26 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| 33 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 27 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| 34 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 28 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 35 #include "chrome/browser/ui/tab_helpers.h" | 29 #include "chrome/browser/ui/tab_helpers.h" |
| 30 #include "chrome/browser/vr/vr_tab_helper.h" |
| 36 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 37 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
| 38 #include "components/app_modal/javascript_dialog_manager.h" | 33 #include "components/app_modal/javascript_dialog_manager.h" |
| 39 #include "components/infobars/core/infobar.h" | 34 #include "components/infobars/core/infobar.h" |
| 40 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
| 41 #include "content/public/browser/notification_details.h" | 36 #include "content/public/browser/notification_details.h" |
| 42 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
| 43 #include "content/public/browser/notification_source.h" | 38 #include "content/public/browser/notification_source.h" |
| 44 #include "content/public/browser/render_process_host.h" | 39 #include "content/public/browser/render_process_host.h" |
| 45 #include "content/public/browser/render_view_host.h" | 40 #include "content/public/browser/render_view_host.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 WebContents* source, bool to_different_document) { | 113 WebContents* source, bool to_different_document) { |
| 119 bool has_stopped = source == nullptr || !source->IsLoading(); | 114 bool has_stopped = source == nullptr || !source->IsLoading(); |
| 120 WebContentsDelegateAndroid::LoadingStateChanged( | 115 WebContentsDelegateAndroid::LoadingStateChanged( |
| 121 source, to_different_document); | 116 source, to_different_document); |
| 122 LoadProgressChanged(source, has_stopped ? 1 : 0); | 117 LoadProgressChanged(source, has_stopped ? 1 : 0); |
| 123 } | 118 } |
| 124 | 119 |
| 125 void TabWebContentsDelegateAndroid::RunFileChooser( | 120 void TabWebContentsDelegateAndroid::RunFileChooser( |
| 126 content::RenderFrameHost* render_frame_host, | 121 content::RenderFrameHost* render_frame_host, |
| 127 const FileChooserParams& params) { | 122 const FileChooserParams& params) { |
| 128 #if BUILDFLAG(ENABLE_VR) | 123 if (vr::VrTabHelper::IsInVr( |
| 129 if (vr_shell::VrTabHelper::IsInVr( | |
| 130 WebContents::FromRenderFrameHost(render_frame_host))) | 124 WebContents::FromRenderFrameHost(render_frame_host))) |
| 131 return; | 125 return; |
| 132 #endif | |
| 133 FileSelectHelper::RunFileChooser(render_frame_host, params); | 126 FileSelectHelper::RunFileChooser(render_frame_host, params); |
| 134 } | 127 } |
| 135 | 128 |
| 136 std::unique_ptr<BluetoothChooser> | 129 std::unique_ptr<BluetoothChooser> |
| 137 TabWebContentsDelegateAndroid::RunBluetoothChooser( | 130 TabWebContentsDelegateAndroid::RunBluetoothChooser( |
| 138 content::RenderFrameHost* frame, | 131 content::RenderFrameHost* frame, |
| 139 const BluetoothChooser::EventHandler& event_handler) { | 132 const BluetoothChooser::EventHandler& event_handler) { |
| 140 #if BUILDFLAG(ENABLE_VR) | 133 #if BUILDFLAG(ENABLE_VR) |
| 141 if (vr_shell::VrTabHelper::IsInVr(WebContents::FromRenderFrameHost(frame))) | 134 if (vr_shell::VrTabHelper::IsInVr(WebContents::FromRenderFrameHost(frame))) |
| 142 return nullptr; | 135 return nullptr; |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 void NotifyStopped(JNIEnv* env, | 486 void NotifyStopped(JNIEnv* env, |
| 494 const JavaParamRef<jclass>& clazz, | 487 const JavaParamRef<jclass>& clazz, |
| 495 const JavaParamRef<jobject>& java_web_contents) { | 488 const JavaParamRef<jobject>& java_web_contents) { |
| 496 content::WebContents* web_contents = | 489 content::WebContents* web_contents = |
| 497 content::WebContents::FromJavaWebContents(java_web_contents); | 490 content::WebContents::FromJavaWebContents(java_web_contents); |
| 498 scoped_refptr<MediaStreamCaptureIndicator> indicator = | 491 scoped_refptr<MediaStreamCaptureIndicator> indicator = |
| 499 MediaCaptureDevicesDispatcher::GetInstance() | 492 MediaCaptureDevicesDispatcher::GetInstance() |
| 500 ->GetMediaStreamCaptureIndicator(); | 493 ->GetMediaStreamCaptureIndicator(); |
| 501 indicator->NotifyStopped(web_contents); | 494 indicator->NotifyStopped(web_contents); |
| 502 } | 495 } |
| OLD | NEW |