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

Unified Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 12205002: Packaged apps manifest requires 'fullscreen' permission for HTML5 api. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed template params from permission_warnings.html Created 7 years, 10 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/extensions/suggest_permission_util.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/browser/extensions/suggest_permission_util.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698