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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/suggest_permission_util.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/extensions/shell_window.h" 5 #include "chrome/browser/ui/extensions/shell_window.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/extension_process_manager.h" 9 #include "chrome/browser/extensions/extension_process_manager.h"
10 #include "chrome/browser/extensions/extension_system.h" 10 #include "chrome/browser/extensions/extension_system.h"
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 DCHECK(source == web_contents_.get()); 535 DCHECK(source == web_contents_.get());
536 if (changed_flags & content::INVALIDATE_TYPE_TITLE) 536 if (changed_flags & content::INVALIDATE_TYPE_TITLE)
537 native_app_window_->UpdateWindowTitle(); 537 native_app_window_->UpdateWindowTitle();
538 else if (changed_flags & content::INVALIDATE_TYPE_TAB) 538 else if (changed_flags & content::INVALIDATE_TYPE_TAB)
539 native_app_window_->UpdateWindowIcon(); 539 native_app_window_->UpdateWindowIcon();
540 } 540 }
541 541
542 void ShellWindow::ToggleFullscreenModeForTab(content::WebContents* source, 542 void ShellWindow::ToggleFullscreenModeForTab(content::WebContents* source,
543 bool enter_fullscreen) { 543 bool enter_fullscreen) {
544 DCHECK(source == web_contents_.get()); 544 DCHECK(source == web_contents_.get());
545 native_app_window_->SetFullscreen(enter_fullscreen); 545 if (source != web_contents_.get())
546 return;
547
548 bool has_permission = IsExtensionWithPermissionOrSuggestInConsole(
549 APIPermission::kFullscreen,
550 extension_,
551 web_contents_->GetRenderViewHost());
552
553 if (has_permission)
554 native_app_window_->SetFullscreen(enter_fullscreen);
546 } 555 }
547 556
548 bool ShellWindow::IsFullscreenForTabOrPending( 557 bool ShellWindow::IsFullscreenForTabOrPending(
549 const content::WebContents* source) const { 558 const content::WebContents* source) const {
550 DCHECK(source == web_contents_.get()); 559 DCHECK(source == web_contents_.get());
551 return native_app_window_->IsFullscreenOrPending(); 560 return native_app_window_->IsFullscreenOrPending();
552 } 561 }
553 562
554 void ShellWindow::Observe(int type, 563 void ShellWindow::Observe(int type,
555 const content::NotificationSource& source, 564 const content::NotificationSource& source,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 const extensions::DraggableRegion& region = *iter; 645 const extensions::DraggableRegion& region = *iter;
637 sk_region->op( 646 sk_region->op(
638 region.bounds.x(), 647 region.bounds.x(),
639 region.bounds.y(), 648 region.bounds.y(),
640 region.bounds.right(), 649 region.bounds.right(),
641 region.bounds.bottom(), 650 region.bounds.bottom(),
642 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 651 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
643 } 652 }
644 return sk_region; 653 return sk_region;
645 } 654 }
OLDNEW
« 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