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

Unified Diff: chrome/browser/android/vr_shell/vr_tab_helper.cc

Issue 2975593002: [vr] Deny permission requests in VR mode
Patch Set: . Created 3 years, 5 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/android/vr_shell/vr_tab_helper.h ('k') | chrome/browser/chrome_quota_permission_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_tab_helper.cc
diff --git a/chrome/browser/android/vr_shell/vr_tab_helper.cc b/chrome/browser/android/vr_shell/vr_tab_helper.cc
deleted file mode 100644
index 20372ea0b463d2a42180bf9bc4f8ddb9b584464c..0000000000000000000000000000000000000000
--- a/chrome/browser/android/vr_shell/vr_tab_helper.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/android/vr_shell/vr_tab_helper.h"
-
-#include "chrome/browser/android/vr_shell/vr_shell_delegate.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/common/web_preferences.h"
-#include "device/vr/android/gvr/gvr_delegate_provider.h"
-
-using content::WebContents;
-using content::WebPreferences;
-
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(vr_shell::VrTabHelper);
-
-namespace vr_shell {
-
-VrTabHelper::VrTabHelper(content::WebContents* contents)
- : web_contents_(contents) {}
-
-VrTabHelper::~VrTabHelper() {}
-
-void VrTabHelper::SetIsInVr(bool is_in_vr) {
- if (is_in_vr_ == is_in_vr)
- return;
-
- is_in_vr_ = is_in_vr;
-
- WebPreferences web_prefs =
- web_contents_->GetRenderViewHost()->GetWebkitPreferences();
- web_prefs.page_popups_suppressed = is_in_vr_;
- web_contents_->GetRenderViewHost()->UpdateWebkitPreferences(web_prefs);
-}
-
-/* static */
-bool VrTabHelper::IsInVr(content::WebContents* contents) {
- VrTabHelper* vr_tab_helper = VrTabHelper::FromWebContents(contents);
- if (!vr_tab_helper) {
- // This can only happen for unittests.
- VrTabHelper::CreateForWebContents(contents);
- vr_tab_helper = VrTabHelper::FromWebContents(contents);
- }
- return vr_tab_helper->is_in_vr();
-}
-
-} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/vr_tab_helper.h ('k') | chrome/browser/chrome_quota_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698