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 |