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

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

Issue 7461059: Fullscreen JS API implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test Created 9 years, 4 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 | « no previous file | chrome/browser/ui/browser.cc » ('j') | content/browser/tab_contents/tab_contents_delegate.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.h
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 30a8d87febb6ef434f8ec50121e94fa1352bc719..eca912d68b9a97d76a43045f8294b6a352895f7f 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -790,6 +790,7 @@ class Browser : public TabHandlerDelegate,
FRIEND_TEST_ALL_PREFIXES(BrowserTest, ConvertTabToAppShortcut);
FRIEND_TEST_ALL_PREFIXES(BrowserTest, OpenAppWindowLikeNtp);
FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch);
+ FRIEND_TEST_ALL_PREFIXES(BrowserTest, TestToggleFullscreenModeForTab);
FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutNoPref);
FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutWindowPref);
FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutTabPref);
@@ -895,6 +896,8 @@ class Browser : public TabHandlerDelegate,
virtual void DidNavigateToPendingEntry(TabContents* tab) OVERRIDE;
virtual content::JavaScriptDialogCreator*
GetJavaScriptDialogCreator() OVERRIDE;
+ virtual void ToggleFullscreenModeForTab(TabContents* tab,
+ bool enter_fullscreen) OVERRIDE;
// Overridden from TabContentsWrapperDelegate:
virtual void OnDidGetApplicationInfo(TabContentsWrapper* source,
@@ -1024,6 +1027,25 @@ class Browser : public TabHandlerDelegate,
// >= index.
void SyncHistoryWithTabs(int index);
+ // Tab fullscreen functions /////////////////////////////////////////////////
+
+ // There are two different kinds of fullscreen mode - "tab fullscreen" and
+ // "browser fullscreen". "Tab fullscreen" refers to when a tab enters
+ // fullscreen mode via the JS fullscreen API, and "browser fullscreen"
+ // refers to the user putting the browser itself into fullscreen mode from
+ // the UI. The difference is that tab fullscreen has implications for how
+ // the contents of the tab render (eg: a video element may grow to consume
+ // the whole tab), whereas browser fullscreen mode doesn't. Therefore if a
+ // user forces an exit from fullscreen, we need to notify the tab so it can
+ // stop rendering in its fullscreen mode.
+
+ // Make the current tab exit fullscreen mode if it is in it.
+ void ExitTabbedFullscreenModeIfNecessary();
+
+ // Notifies the tab that it has been forced out of fullscreen mode if
+ // necessary.
+ void NotifyTabOfFullscreenExitIfNecessary();
+
// OnBeforeUnload handling //////////////////////////////////////////////////
typedef std::set<TabContents*> UnloadListenerSet;
@@ -1147,6 +1169,14 @@ class Browser : public TabHandlerDelegate,
// Open the bookmark manager with a defined hash action.
void OpenBookmarkManagerWithHash(const std::string& action, int64 node_id);
+ // Make the current tab exit fullscreen mode. If the browser was fullscreen
+ // because of that (as opposed to the user clicking the fullscreen button)
+ // then take the browser out of fullscreen mode as well.
+ void ExitTabbedFullscreenMode();
+
+ // Notifies the tab that it has been forced out of fullscreen mode.
+ void NotifyTabOfFullscreenExit();
+
// Data members /////////////////////////////////////////////////////////////
NotificationRegistrar registrar_;
@@ -1289,6 +1319,12 @@ class Browser : public TabHandlerDelegate,
BookmarkBar::State bookmark_bar_state_;
+ // Tab to notify when the browser exits fullscreen mode.
+ TabContentsWrapper* fullscreened_tab_;
+
+ // True if the current tab is in fullscreen mode.
+ bool tab_caused_fullscreen_;
+
DISALLOW_COPY_AND_ASSIGN(Browser);
};
« no previous file with comments | « no previous file | chrome/browser/ui/browser.cc » ('j') | content/browser/tab_contents/tab_contents_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698