| 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
|
| index eef1ffbc6e79e53eb91c1df581f4c4e7020a3b5b..3121cd2eedb0618ccae118ae20436b73c3856b7f 100644
|
| --- a/chrome/browser/android/vr_shell/vr_tab_helper.cc
|
| +++ b/chrome/browser/android/vr_shell/vr_tab_helper.cc
|
| @@ -5,17 +5,32 @@
|
| #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) {}
|
| +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 */
|
|
|