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

Unified Diff: apps/shell_window.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: Add an explanation of fullscreen mode. 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
Index: apps/shell_window.cc
diff --git a/apps/shell_window.cc b/apps/shell_window.cc
index 425adf6cb7b5e2fdaba7d7c4510f5999ffbae781..96c6abd7ed63de73d0dbfbbf9d87699b44e5e976 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_,

Powered by Google App Engine
This is Rietveld 408576698