Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Unified Diff: chrome/browser/android/tab_web_contents_delegate_android.cc

Issue 2874623004: [vr] Introduce VrTabHelper (Closed)
Patch Set: nogncheck (thanks sadrul@, sky@)! Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/tab_web_contents_delegate_android.cc
diff --git a/chrome/browser/android/tab_web_contents_delegate_android.cc b/chrome/browser/android/tab_web_contents_delegate_android.cc
index fa26ef6cfad50bcdd5315f2e88982dc4be8703f2..a010e88d2954b17d791f8998a99d6fc6f1344d05 100644
--- a/chrome/browser/android/tab_web_contents_delegate_android.cc
+++ b/chrome/browser/android/tab_web_contents_delegate_android.cc
@@ -13,6 +13,12 @@
#include "chrome/browser/android/banners/app_banner_manager_android.h"
#include "chrome/browser/android/feature_utilities.h"
#include "chrome/browser/android/hung_renderer_infobar_delegate.h"
+
+#include "device/vr/features/features.h"
+#if BUILDFLAG(ENABLE_VR)
+#include "chrome/browser/android/vr_shell/vr_tab_helper.h"
+#endif // BUILDFLAG(ENABLE_VR)
+
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/file_select_helper.h"
#include "chrome/browser/infobars/infobar_service.h"
@@ -119,6 +125,12 @@ void TabWebContentsDelegateAndroid::LoadingStateChanged(
void TabWebContentsDelegateAndroid::RunFileChooser(
content::RenderFrameHost* render_frame_host,
const FileChooserParams& params) {
+#if BUILDFLAG(ENABLE_VR)
+ if (vr_shell::VrTabHelper::IsInVr(
+ WebContents::FromRenderFrameHost(render_frame_host))) {
+ return;
+ }
+#endif
FileSelectHelper::RunFileChooser(render_frame_host, params);
}
@@ -255,6 +267,11 @@ void TabWebContentsDelegateAndroid::FindMatchRectsReply(
content::JavaScriptDialogManager*
TabWebContentsDelegateAndroid::GetJavaScriptDialogManager(
WebContents* source) {
+#if BUILDFLAG(ENABLE_VR)
+ if (vr_shell::VrTabHelper::IsInVr(source)) {
+ return nullptr;
+ }
+#endif
return app_modal::JavaScriptDialogManager::GetInstance();
}
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698