summaryrefslogtreecommitdiffstats
path: root/apps/shell_window.cc
diff options
context:
space:
mode:
authorbartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-25 15:48:25 +0000
committerbartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-25 15:48:25 +0000
commit32dfede31f73b2ad13b415d7c5ed21734b3ab8d1 (patch)
treea622d8ee73921661d3ac138bad86faedb56c1b4a /apps/shell_window.cc
parente5232a59005b3d5a9051c6061d97bdb46f71bc37 (diff)
downloadchromium_src-32dfede31f73b2ad13b415d7c5ed21734b3ab8d1.zip
chromium_src-32dfede31f73b2ad13b415d7c5ed21734b3ab8d1.tar.gz
chromium_src-32dfede31f73b2ad13b415d7c5ed21734b3ab8d1.tar.bz2
Add policy for fullscreen mode; disallow fullscreen in public sessions
This CL adds a user policy that determines whether fullscreen mode is allowed and uses it to disallow fullscreen mode in public sessions. BUG=275405 TEST=New browser tests Review URL: https://chromiumcodereview.appspot.com/22986010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219482 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/shell_window.cc')
-rw-r--r--apps/shell_window.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/shell_window.cc b/apps/shell_window.cc
index 425adf6..96c6abd 100644
--- a/apps/shell_window.cc
+++ b/apps/shell_window.cc
@@ -37,6 +37,11 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/screen.h"
+#if !defined(OS_MACOSX)
+#include "apps/pref_names.h"
+#include "base/prefs/pref_service.h"
+#endif
+
using content::ConsoleMessageLevel;
using content::WebContents;
using extensions::APIPermission;
@@ -494,6 +499,16 @@ void ShellWindow::NavigationStateChanged(
void ShellWindow::ToggleFullscreenModeForTab(content::WebContents* source,
bool enter_fullscreen) {
+#if !defined(OS_MACOSX)
+ // Do not enter fullscreen mode if disallowed by pref.
+ // TODO(bartfab): Add a test once it becomes possible to simulate a user
+ // gesture. http://crbug.com/174178
+ if (enter_fullscreen &&
+ !profile()->GetPrefs()->GetBoolean(prefs::kAppFullscreenAllowed)) {
+ return;
+ }
+#endif
+
if (!IsExtensionWithPermissionOrSuggestInConsole(
APIPermission::kFullscreen,
extension_,