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

Unified Diff: chrome/browser/ui/fullscreen/fullscreen_controller.cc

Issue 22986010: Add policy for fullscreen mode; disallow fullscreen in public sessions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser test compilation after rebase. Created 7 years, 4 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/ui/browser_ui_prefs.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/fullscreen/fullscreen_controller.cc
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller.cc b/chrome/browser/ui/fullscreen/fullscreen_controller.cc
index 7c1621e0a32673e73d50ff51c71ef71a61af55d4..d275cfe69950c57cab05096e8fadd071daea269c 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller.cc
@@ -28,6 +28,9 @@
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
+#else
+#include "base/prefs/pref_service.h"
+#include "chrome/common/pref_names.h"
#endif
using content::RenderViewHost;
@@ -552,6 +555,16 @@ void FullscreenController::ToggleFullscreenModeInternal(
if (chrome::IsRunningInAppMode() && window_->IsFullscreen())
return;
+#if !defined(OS_MACOSX)
+ // Do not enter fullscreen mode if disallowed by pref. This prevents the user
+ // from manually entering fullscreen mode and also disables kiosk mode on
+ // desktop platforms.
+ if (enter_fullscreen &&
+ !profile_->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) {
+ return;
+ }
+#endif
+
if (enter_fullscreen)
EnterFullscreenModeInternal(option);
else
« no previous file with comments | « chrome/browser/ui/browser_ui_prefs.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698