Index: chrome/browser/ui/extensions/shell_window.cc |
diff --git a/chrome/browser/ui/extensions/shell_window.cc b/chrome/browser/ui/extensions/shell_window.cc |
index 8be9cce5aec0a8d056b07780de034b8454e03728..cc6972f6d2eb0a64c27e54c779b6384f771505e4 100644 |
--- a/chrome/browser/ui/extensions/shell_window.cc |
+++ b/chrome/browser/ui/extensions/shell_window.cc |
@@ -542,7 +542,16 @@ void ShellWindow::NavigationStateChanged( |
void ShellWindow::ToggleFullscreenModeForTab(content::WebContents* source, |
bool enter_fullscreen) { |
DCHECK(source == web_contents_.get()); |
- native_app_window_->SetFullscreen(enter_fullscreen); |
+ if (source != web_contents_.get()) |
+ return; |
+ |
+ bool has_permission = IsExtensionWithPermissionOrSuggestInConsole( |
+ APIPermission::kFullscreen, |
+ extension_, |
+ web_contents_->GetRenderViewHost()); |
+ |
+ if (has_permission) |
+ native_app_window_->SetFullscreen(enter_fullscreen); |
} |
bool ShellWindow::IsFullscreenForTabOrPending( |