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

Side by Side Diff: chrome/browser/android/vr_shell/vr_tab_helper.cc

Issue 2904623002: Disable permissions dialog in VR (Closed)
Patch Set: Add comment Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/vr_shell/vr_tab_helper.h" 5 #include "chrome/browser/android/vr_shell/vr_tab_helper.h"
6 6
7 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h" 7 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h"
8 #include "content/public/browser/render_view_host.h" 8 #include "content/public/browser/render_view_host.h"
9 #include "content/public/common/web_preferences.h" 9 #include "content/public/common/web_preferences.h"
10 #include "device/vr/android/gvr/gvr_delegate_provider.h" 10 #include "device/vr/android/gvr/gvr_delegate_provider.h"
(...skipping 18 matching lines...) Expand all
29 29
30 WebPreferences web_prefs = 30 WebPreferences web_prefs =
31 web_contents_->GetRenderViewHost()->GetWebkitPreferences(); 31 web_contents_->GetRenderViewHost()->GetWebkitPreferences();
32 web_prefs.page_popups_suppressed = is_in_vr_; 32 web_prefs.page_popups_suppressed = is_in_vr_;
33 web_contents_->GetRenderViewHost()->UpdateWebkitPreferences(web_prefs); 33 web_contents_->GetRenderViewHost()->UpdateWebkitPreferences(web_prefs);
34 } 34 }
35 35
36 /* static */ 36 /* static */
37 bool VrTabHelper::IsInVr(content::WebContents* contents) { 37 bool VrTabHelper::IsInVr(content::WebContents* contents) {
38 VrTabHelper* vr_tab_helper = VrTabHelper::FromWebContents(contents); 38 VrTabHelper* vr_tab_helper = VrTabHelper::FromWebContents(contents);
39 if (!vr_tab_helper) {
40 // This can only happen for unittests.
41 VrTabHelper::CreateForWebContents(contents);
42 vr_tab_helper = VrTabHelper::FromWebContents(contents);
43 }
39 return vr_tab_helper->is_in_vr(); 44 return vr_tab_helper->is_in_vr();
40 } 45 }
41 46
42 } // namespace vr_shell 47 } // namespace vr_shell
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698