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

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

Issue 158253002: Tabs being screen-captured will fullscreen within their tab contents area. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: chrome/browser/ui/fullscreen/fullscreen_controller.h
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller.h b/chrome/browser/ui/fullscreen/fullscreen_controller.h
index 6a5aa4b517bc6ab06f0a79d1e676c35cca2d5ead..0ec48b9aa356b5a20959da1030ba74499bd25394 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller.h
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_
#define CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_
+#include <vector>
+
#include "base/basictypes.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h"
@@ -34,6 +36,14 @@ class WebContents;
// For Flash, FullscreenController will auto-accept all permission requests for
// fullscreen and/or mouse lock, since the assumption is that the plugin handles
// this for us.
+//
+// Special behavior for screen-captured tabs: When embedded fullscreen widgets
scheib 2014/02/12 01:41:16 Consider anchoring/naming this note with e.g. """
miu 2014/02/12 08:25:19 Done.
+// are enabled and the renderer toggles into fullscreen mode, the browser window
+// will not expand to enter fullscreen. This allows the user to retain control
+// of their desktop to work in other browser tabs or applications while the
+// fullscreen view is displayed on a remote screen. FullscreenController will
+// track which WebContentses have renderers in fullscreen mode, and use an
+// alternate set of heuristics to manage them.
// This class implements fullscreen and mouselock behaviour.
class FullscreenController : public content::NotificationObserver {
@@ -54,6 +64,13 @@ class FullscreenController : public content::NotificationObserver {
// Returns true if fullscreen has been caused by a tab.
// The window may still be transitioning, and window_->IsFullscreen()
// may still return false.
+ //
+ // NOTE: The zero-argument version returns true iff a fullscreen tab will
scheib 2014/02/12 01:41:16 For clarity (presuming I have it right): "iff a fu
miu 2014/02/12 08:25:19 Done.
+ // result in the browser window expanding to fill the screen. On the other
+ // hand, the one-argument version will return true while the renderer is/will
+ // be in fullscreen mode, but not necessarily the browser window. The latter
+ // case accounts for the special behavior employed during screen capture of a
scheib 2014/02/12 01:41:16 And then reference "See 'EmbeddedFullscreen Note'"
miu 2014/02/12 08:25:19 Done.
+ // WebContents where the fullscreen view remains within the browser tab.
bool IsFullscreenForTabOrPending() const;
scheib 2014/02/12 01:41:16 Consider renaming the method to differentiate the
miu 2014/02/12 08:25:19 Agreed. There are quite a few callers of it, so I
scheib 2014/02/12 18:01:36 Yes.
bool IsFullscreenForTabOrPending(
const content::WebContents* web_contents) const;
@@ -98,6 +115,9 @@ class FullscreenController : public content::NotificationObserver {
// Called by Browser::TabDeactivated.
void OnTabDeactivated(content::WebContents* web_contents);
+ // Called by Browser::ActiveTabChanged.
+ void OnTabDetachedFromView(content::WebContents* web_contents);
+
// Called by Browser::TabClosingAt.
void OnTabClosing(content::WebContents* web_contents);
@@ -173,6 +193,16 @@ class FullscreenController : public content::NotificationObserver {
bool IsPrivilegedFullscreenForTab() const;
void SetPrivilegedFullscreenForTesting(bool is_privileged);
+ // Returns true if embedded fullscreen features have been enabled for the
+ // |browser_|.
scheib 2014/02/12 01:41:16 And then reference "See 'EmbeddedFullscreen Note'"
miu 2014/02/12 08:25:19 Done.
+ bool IsEmbeddedFullscreenEnabled() const;
scheib 2014/02/12 01:41:16 Use a consistent terminology, always 'EmbeddedFull
miu 2014/02/12 08:25:19 I see your point, and agree the naming was confusi
scheib 2014/02/12 18:01:36 Thanks - I think it's clearer now - though still s
+ // Returns true if |web_contents| is/was being screen-captured and was
+ // toggled into/out of fullscreen-within-tab mode.
+ bool MaybeToggleAsFullscreenWithinTab(content::WebContents* web_contents,
+ bool enter_fullscreen);
+ // Returns true if |web_contents| has its fullscreen view embedded within a
+ // browser tab and is being screen captured.
+ bool IsCapturedFullscreenTab(const content::WebContents* web_contents) const;
void UnlockMouse();
Browser* const browser_;
@@ -217,6 +247,12 @@ class FullscreenController : public content::NotificationObserver {
// WindowFullscreenStateChanged do so.
bool reentrant_window_state_change_call_check_;
+ // A WebContents pointer is in this set if it entered fullscreen mode during
+ // screen capture. In other words, this tracks those WebContentses that are
+ // in fullscreen mode, but the browser window is not. Note: Behavior only
+ // applies when IsEmbeddedFullscreenEnabled() returns true.
+ std::vector<const content::WebContents*> captured_tabs_;
+
// Used in testing to confirm proper behavior for specific, privileged
// fullscreen cases.
bool is_privileged_fullscreen_for_testing_;

Powered by Google App Engine
This is Rietveld 408576698