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

Unified Diff: chrome/browser/ui/fullscreen/fullscreen_controller.cc

Issue 98523003: Implement "presentation" feature for window.open() Base URL: https://github.com/drott/cameo.git@presentationWindowSquashed
Patch Set: Created 7 years 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: chrome/browser/ui/fullscreen/fullscreen_controller.cc
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller.cc b/chrome/browser/ui/fullscreen/fullscreen_controller.cc
index c84260cbf1ad6cbc2091848882d1e2388d0c8454..ffd08bff3a030e696062410a776d12724c1b7809 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller.cc
@@ -47,6 +47,7 @@ FullscreenController::FullscreenController(Browser* browser)
tab_fullscreen_accepted_(false),
toggled_into_fullscreen_(false),
mouse_lock_tab_(NULL),
+ is_presentation_browser_fullscreen(false),
mouse_lock_state_(MOUSELOCK_NOT_REQUESTED),
reentrant_window_state_change_call_check_(false),
is_privileged_fullscreen_for_testing_(false),
@@ -167,6 +168,15 @@ void FullscreenController::ToggleFullscreenModeForTab(WebContents* web_contents,
}
}
+void FullscreenController::TogglePresentationMode() {
+ extension_caused_fullscreen_ = GURL();
+ ToggleFullscreenModeInternal(PRESENTATION);
+}
+
+bool FullscreenController::IsPresentationFullscreen() {
+ return is_presentation_browser_fullscreen;
+}
+
void FullscreenController::ToggleFullscreenModeWithExtension(
const GURL& extension_url) {
// |extension_caused_fullscreen_| will be reset if this causes fullscreen to
@@ -312,6 +322,11 @@ bool FullscreenController::HandleUserPressedEscape() {
return true;
}
+ if (IsPresentationFullscreen()) {
+ ExitFullscreenModeInternal();
+ return true;
+ }
+
return false;
}
@@ -464,8 +479,11 @@ FullscreenExitBubbleType FullscreenController::GetFullscreenExitBubbleType()
} else {
if (!extension_caused_fullscreen_.is_empty()) {
return FEB_TYPE_BROWSER_EXTENSION_FULLSCREEN_EXIT_INSTRUCTION;
- } else if (toggled_into_fullscreen_ && !app_mode) {
+ } else if (toggled_into_fullscreen_ && !app_mode &&
+ !is_presentation_browser_fullscreen) {
return FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION;
+ } else if (is_presentation_browser_fullscreen) {
+ return FEB_TYPE_PRESENTATION_FULLSCREEN_EXIT_INSTRUCTION;
} else {
return FEB_TYPE_NONE;
}
@@ -590,7 +608,7 @@ void FullscreenController::EnterFullscreenModeInternal(
url = extension_caused_fullscreen_;
}
- if (option == BROWSER)
+ if (option == BROWSER || option == PRESENTATION)
content::RecordAction(UserMetricsAction("ToggleFullscreen"));
// TODO(scheib): Record metrics for WITH_CHROME, without counting transitions
// from tab fullscreen out to browser with chrome.
@@ -603,6 +621,10 @@ void FullscreenController::EnterFullscreenModeInternal(
#else
{
#endif
+
+ if (option == PRESENTATION)
+ is_presentation_browser_fullscreen = true;
+
window_->EnterFullscreen(url, GetFullscreenExitBubbleType());
}
@@ -622,8 +644,12 @@ void FullscreenController::ExitFullscreenModeInternal() {
// state_prior_to_tab_fullscreen_ will be incorrect.
NotifyTabOfExitIfNecessary();
#endif
- window_->ExitFullscreen();
+ if (is_presentation_browser_fullscreen)
+ window_->Close();
+ else
+ window_->ExitFullscreen();
extension_caused_fullscreen_ = GURL();
+ is_presentation_browser_fullscreen = false;
UpdateFullscreenExitBubbleContent();
}
« no previous file with comments | « chrome/browser/ui/fullscreen/fullscreen_controller.h ('k') | chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698