summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 06:30:47 +0000
committerkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 06:30:47 +0000
commit8a5e0ca85f7bfc59b12ba0e410738088f3f8a2bd (patch)
treebe5b7ff94ffba83a72b9d9a85db9119334928c07
parent43e92dd49721fb81923372530d2efa55cccf2374 (diff)
downloadchromium_src-8a5e0ca85f7bfc59b12ba0e410738088f3f8a2bd.zip
chromium_src-8a5e0ca85f7bfc59b12ba0e410738088f3f8a2bd.tar.gz
chromium_src-8a5e0ca85f7bfc59b12ba0e410738088f3f8a2bd.tar.bz2
Fullscreen JS API implementation.
BUG= TEST= Review URL: http://codereview.chromium.org/7461059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98193 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/browser.cc49
-rw-r--r--chrome/browser/ui/browser.h41
-rw-r--r--chrome/browser/ui/browser_browsertest.cc30
-rw-r--r--chrome/browser/ui/tab_contents/tab_contents_wrapper.cc4
-rw-r--r--chrome/browser/ui/tab_contents/tab_contents_wrapper.h3
-rw-r--r--chrome/common/chrome_notification_types.h3
-rw-r--r--content/browser/renderer_host/render_view_host.cc7
-rw-r--r--content/browser/renderer_host/render_view_host.h1
-rw-r--r--content/browser/renderer_host/render_view_host_delegate.h3
-rw-r--r--content/browser/tab_contents/tab_contents.cc5
-rw-r--r--content/browser/tab_contents/tab_contents.h1
-rw-r--r--content/browser/tab_contents/tab_contents_delegate.cc4
-rw-r--r--content/browser/tab_contents/tab_contents_delegate.h4
-rw-r--r--content/common/view_messages.h8
-rw-r--r--content/renderer/render_view.cc15
-rw-r--r--content/renderer/render_view.h3
16 files changed, 177 insertions, 4 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 7a3b85e..c54df51 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -262,7 +262,9 @@ Browser::Browser(Type type, Profile* profile)
ALLOW_THIS_IN_INITIALIZER_LIST(
synced_window_delegate_(
new BrowserSyncedWindowDelegate(this))),
- bookmark_bar_state_(BookmarkBar::HIDDEN) {
+ bookmark_bar_state_(BookmarkBar::HIDDEN),
+ fullscreened_tab_(NULL),
+ tab_caused_fullscreen_(false) {
registrar_.Add(this, content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
NotificationService::AllSources());
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
@@ -1282,6 +1284,16 @@ void Browser::ShowSingletonTabOverwritingNTP(
void Browser::WindowFullscreenStateChanged() {
UpdateCommandsForFullscreenMode(window_->IsFullscreen());
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN);
+ MessageLoop::current()->PostTask(
+ FROM_HERE, method_factory_.NewRunnableMethod(
+ &Browser::NotifyFullscreenChange));
+}
+
+void Browser::NotifyFullscreenChange() {
+ NotificationService::current()->Notify(
+ chrome::NOTIFICATION_FULLSCREEN_CHANGED,
+ Source<Browser>(this),
+ NotificationService::NoDetails());
}
///////////////////////////////////////////////////////////////////////////////
@@ -1630,6 +1642,8 @@ void Browser::ConvertPopupToTabbedBrowser() {
}
void Browser::ToggleFullscreenMode() {
+ bool entering_fullscreen = !window_->IsFullscreen();
+
#if !defined(OS_MACOSX)
// In kiosk mode, we always want to be fullscreen. When the browser first
// starts we're not yet fullscreen, so let the initial toggle go through.
@@ -1639,7 +1653,7 @@ void Browser::ToggleFullscreenMode() {
#endif
UserMetrics::RecordAction(UserMetricsAction("ToggleFullscreen"));
- window_->SetFullscreen(!window_->IsFullscreen());
+ window_->SetFullscreen(entering_fullscreen);
// Once the window has become fullscreen it'll call back to
// WindowFullscreenStateChanged(). We don't do this immediately as
@@ -1651,6 +1665,16 @@ void Browser::ToggleFullscreenMode() {
#if defined(OS_MACOSX)
WindowFullscreenStateChanged();
#endif
+
+ if (!entering_fullscreen)
+ NotifyTabOfFullscreenExitIfNecessary();
+}
+
+void Browser::NotifyTabOfFullscreenExitIfNecessary() {
+ if (fullscreened_tab_)
+ fullscreened_tab_->ExitFullscreenMode();
+ fullscreened_tab_ = NULL;
+ tab_caused_fullscreen_ = false;
}
#if defined(OS_MACOSX)
@@ -2996,6 +3020,8 @@ void Browser::TabDetachedAt(TabContentsWrapper* contents, int index) {
}
void Browser::TabDeactivated(TabContentsWrapper* contents) {
+ if (contents == fullscreened_tab_)
+ ExitTabbedFullscreenModeIfNecessary();
if (instant())
instant()->DestroyPreviewContents();
@@ -3599,6 +3625,25 @@ void Browser::EnumerateDirectory(TabContents* tab, int request_id,
Browser::EnumerateDirectoryHelper(tab, request_id, path);
}
+void Browser::ToggleFullscreenModeForTab(TabContents* tab,
+ bool enter_fullscreen) {
+ if (tab != GetSelectedTabContents())
+ return;
+ fullscreened_tab_ = enter_fullscreen ?
+ TabContentsWrapper::GetCurrentWrapperForContents(tab) : NULL;
+ if (enter_fullscreen && !window_->IsFullscreen())
+ tab_caused_fullscreen_ = true;
+ if (tab_caused_fullscreen_)
+ ToggleFullscreenMode();
+}
+
+void Browser::ExitTabbedFullscreenModeIfNecessary() {
+ if (tab_caused_fullscreen_)
+ ToggleFullscreenMode();
+ else
+ NotifyTabOfFullscreenExitIfNecessary();
+}
+
///////////////////////////////////////////////////////////////////////////////
// Browser, TabContentsWrapperDelegate implementation:
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 98d5667..c2f8bc3 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -466,6 +466,9 @@ class Browser : public TabHandlerDelegate,
// fullscreen.
void WindowFullscreenStateChanged();
+ // Sends a notification that the fullscreen state has changed.
+ void NotifyFullscreenChange();
+
// Assorted browser commands ////////////////////////////////////////////////
// NOTE: Within each of the following sections, the IDs are ordered roughly by
@@ -792,6 +795,8 @@ 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, TestNewTabExitsFullscreen);
+ FRIEND_TEST_ALL_PREFIXES(BrowserTest, TestTabExitsItselfFromFullscreen);
FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutNoPref);
FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutWindowPref);
FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutTabPref);
@@ -902,7 +907,8 @@ class Browser : public TabHandlerDelegate,
const ViewHostMsg_RunFileChooser_Params& params) OVERRIDE;
virtual void EnumerateDirectory(TabContents* tab, int request_id,
const FilePath& path) OVERRIDE;
-
+ virtual void ToggleFullscreenModeForTab(TabContents* tab,
+ bool enter_fullscreen) OVERRIDE;
// Overridden from TabContentsWrapperDelegate:
virtual void OnDidGetApplicationInfo(TabContentsWrapper* source,
@@ -1032,6 +1038,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;
@@ -1155,6 +1180,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_;
@@ -1298,6 +1331,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);
};
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index 36cb4c1..6c5135c 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -635,6 +635,36 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageLanguageDetection) {
EXPECT_EQ("fr", helper->language_state().original_language());
}
+IN_PROC_BROWSER_TEST_F(BrowserTest, TestNewTabExitsFullscreen) {
+ ASSERT_TRUE(test_server()->Start());
+
+ AddTabAtIndex(0, GURL("about:blank"), PageTransition::TYPED);
+
+ TabContents* fullscreen_tab = browser()->GetSelectedTabContents();
+
+ browser()->ToggleFullscreenModeForTab(fullscreen_tab, true);
+ ui_test_utils::WaitForNotification(chrome::NOTIFICATION_FULLSCREEN_CHANGED);
+ ASSERT_TRUE(browser()->window()->IsFullscreen());
+ AddTabAtIndex(1, GURL("about:blank"), PageTransition::TYPED);
+ ui_test_utils::WaitForNotification(chrome::NOTIFICATION_FULLSCREEN_CHANGED);
+ ASSERT_FALSE(browser()->window()->IsFullscreen());
+}
+
+IN_PROC_BROWSER_TEST_F(BrowserTest, TestTabExitsItselfFromFullscreen) {
+ ASSERT_TRUE(test_server()->Start());
+
+ AddTabAtIndex(0, GURL("about:blank"), PageTransition::TYPED);
+
+ TabContents* fullscreen_tab = browser()->GetSelectedTabContents();
+
+ browser()->ToggleFullscreenModeForTab(fullscreen_tab, true);
+ ui_test_utils::WaitForNotification(chrome::NOTIFICATION_FULLSCREEN_CHANGED);
+ ASSERT_TRUE(browser()->window()->IsFullscreen());
+ browser()->ToggleFullscreenModeForTab(fullscreen_tab, false);
+ ui_test_utils::WaitForNotification(chrome::NOTIFICATION_FULLSCREEN_CHANGED);
+ ASSERT_FALSE(browser()->window()->IsFullscreen());
+}
+
// Chromeos defaults to restoring the last session, so this test isn't
// applicable.
#if !defined(OS_CHROMEOS)
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
index 99e2606..6fc949b 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
@@ -841,3 +841,7 @@ void TabContentsWrapper::RemoveAllInfoBars(bool animate) {
while (!infobars_.empty())
RemoveInfoBarInternal(GetInfoBarDelegateAt(infobar_count() - 1), animate);
}
+
+void TabContentsWrapper::ExitFullscreenMode() {
+ Send(new ViewMsg_ExitFullscreen(routing_id()));
+}
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h
index 859dfcf..792a77c 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h
@@ -240,6 +240,9 @@ class TabContentsWrapper : public TabContentsObserver,
InfoBarDelegate* GetInfoBarDelegateAt(size_t index);
void set_infobars_enabled(bool value) { infobars_enabled_ = value; }
+ // Stop this tab rendering in fullscreen mode.
+ void ExitFullscreenMode();
+
private:
// Internal helpers ----------------------------------------------------------
diff --git a/chrome/common/chrome_notification_types.h b/chrome/common/chrome_notification_types.h
index b515cfa..0f3dc08 100644
--- a/chrome/common/chrome_notification_types.h
+++ b/chrome/common/chrome_notification_types.h
@@ -871,6 +871,9 @@ enum {
// Sent when the cached profile info has changed.
NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
+ // Sent when the browser enters or exits fullscreen mode.
+ NOTIFICATION_FULLSCREEN_CHANGED,
+
// Note:-
// Currently only Content and Chrome define and use notifications.
// Custom notifications not belonging to Content and Chrome should start
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index a65e97a..792151a 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -684,6 +684,8 @@ bool RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentOnLoadCompletedInMainFrame,
OnMsgDocumentOnLoadCompletedInMainFrame)
IPC_MESSAGE_HANDLER(ViewHostMsg_ContextMenu, OnMsgContextMenu)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_ToggleFullscreen,
+ OnMsgToggleFullscreen)
IPC_MESSAGE_HANDLER(ViewHostMsg_OpenURL, OnMsgOpenURL)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange,
OnMsgDidContentsPreferredSizeChange)
@@ -983,6 +985,11 @@ void RenderViewHost::OnMsgContextMenu(const ContextMenuParams& params) {
view->ShowContextMenu(validated_params);
}
+void RenderViewHost::OnMsgToggleFullscreen(bool enter_fullscreen) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ delegate_->ToggleFullscreenMode(enter_fullscreen);
+}
+
void RenderViewHost::OnMsgOpenURL(const GURL& url,
const GURL& referrer,
WindowOpenDisposition disposition) {
diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h
index 17f47a6..f403243 100644
--- a/content/browser/renderer_host/render_view_host.h
+++ b/content/browser/renderer_host/render_view_host.h
@@ -428,6 +428,7 @@ class RenderViewHost : public RenderWidgetHost {
void OnMsgDocumentAvailableInMainFrame();
void OnMsgDocumentOnLoadCompletedInMainFrame(int32 page_id);
void OnMsgContextMenu(const ContextMenuParams& params);
+ void OnMsgToggleFullscreen(bool enter_fullscreen);
void OnMsgOpenURL(const GURL& url, const GURL& referrer,
WindowOpenDisposition disposition);
void OnMsgDidContentsPreferredSizeChange(const gfx::Size& new_size);
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h
index 2dad081..cda683b3 100644
--- a/content/browser/renderer_host/render_view_host_delegate.h
+++ b/content/browser/renderer_host/render_view_host_delegate.h
@@ -372,6 +372,9 @@ class RenderViewHostDelegate : public IPC::Channel::Listener {
RenderViewHost* render_view_host,
const ViewHostMsg_RunFileChooser_Params& params) {}
+ // Notification that the page wants to go into or out of fullscreen mode.
+ virtual void ToggleFullscreenMode(bool enter_fullscreen) {}
+
protected:
virtual ~RenderViewHostDelegate() {}
};
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 6caebbe..e337fe8 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -498,6 +498,11 @@ void TabContents::HandleMouseActivate() {
delegate_->HandleMouseActivate();
}
+void TabContents::ToggleFullscreenMode(bool enter_fullscreen) {
+ if (delegate_)
+ delegate_->ToggleFullscreenModeForTab(this, enter_fullscreen);
+}
+
void TabContents::ShowContents() {
RenderWidgetHostView* rwhv = GetRenderWidgetHostView();
if (rwhv)
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index 84f0134..8acf579 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -707,6 +707,7 @@ class TabContents : public PageNavigator,
virtual bool OnMessageReceived(const IPC::Message& message);
virtual void RunFileChooser(RenderViewHost* render_view_host,
const ViewHostMsg_RunFileChooser_Params& params);
+ virtual void ToggleFullscreenMode(bool enter_fullscreen) OVERRIDE;
// RenderViewHostManager::Delegate -------------------------------------------
diff --git a/content/browser/tab_contents/tab_contents_delegate.cc b/content/browser/tab_contents/tab_contents_delegate.cc
index ac03388..eb29c07 100644
--- a/content/browser/tab_contents/tab_contents_delegate.cc
+++ b/content/browser/tab_contents/tab_contents_delegate.cc
@@ -288,6 +288,10 @@ void TabContentsDelegate::EnumerateDirectory(TabContents* tab, int request_id,
const FilePath& path) {
}
+void TabContentsDelegate::ToggleFullscreenModeForTab(TabContents* tab,
+ bool enter_fullscreen) {
+}
+
TabContentsDelegate::~TabContentsDelegate() {
while (!attached_contents_.empty()) {
TabContents* tab_contents = *attached_contents_.begin();
diff --git a/content/browser/tab_contents/tab_contents_delegate.h b/content/browser/tab_contents/tab_contents_delegate.h
index 1118cf7..bae80c6 100644
--- a/content/browser/tab_contents/tab_contents_delegate.h
+++ b/content/browser/tab_contents/tab_contents_delegate.h
@@ -310,6 +310,10 @@ class TabContentsDelegate {
virtual void EnumerateDirectory(TabContents* tab, int request_id,
const FilePath& path);
+ // Called when the renderer puts a tab into or out of fullscreen mode.
+ virtual void ToggleFullscreenModeForTab(TabContents* tab,
+ bool enter_fullscreen);
+
protected:
virtual ~TabContentsDelegate();
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 7c81a07..2a7a839 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -1244,6 +1244,9 @@ IPC_MESSAGE_ROUTED2(ViewMsg_SavePageAsMHTML,
int /* job_id */,
IPC::PlatformFileForTransit /* file handle */)
+// Exit fullscreen.
+IPC_MESSAGE_ROUTED0(ViewMsg_ExitFullscreen)
+
// Messages sent from the renderer to the browser.
// Sent by the renderer when it is creating a new window. The browser creates
@@ -2053,6 +2056,11 @@ IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateInspectorSetting,
std::string, /* key */
std::string /* value */)
+// Puts the browser into "tab fullscreen" mode for the sending renderer.
+// See the comment in chrome/browser/ui/browser.h for more details.
+IPC_MESSAGE_ROUTED1(ViewHostMsg_ToggleFullscreen,
+ bool /* enter_fullscreen */)
+
// Send back a string to be recorded by UserMetrics.
IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction,
std::string /* action */)
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index f2d7412..f1eef24 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -388,7 +388,7 @@ RenderView::RenderView(RenderThreadBase* render_thread,
render_thread_->AddRoute(routing_id_, this);
// Take a reference on behalf of the RenderThread. This will be balanced
- // when we receive ViewMsg_Close.
+ // when we receive ViewMsg_ClosePage.
AddRef();
// If this is a popup, we must wait for the CreatingNew_ACK message before
@@ -631,6 +631,7 @@ bool RenderView::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevel, OnSetZoomLevel)
IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL,
OnSetZoomLevelForLoadingURL)
+ IPC_MESSAGE_HANDLER(ViewMsg_ExitFullscreen, OnExitFullscreen)
IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding)
IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault,
OnResetPageEncodingToDefault)
@@ -1739,6 +1740,14 @@ void RenderView::exitFullscreenForNode(const WebKit::WebNode& node) {
NOTIMPLEMENTED();
}
+void RenderView::enterFullscreen() {
+ Send(new ViewHostMsg_ToggleFullscreen(routing_id_, true));
+}
+
+void RenderView::exitFullscreen() {
+ Send(new ViewHostMsg_ToggleFullscreen(routing_id_, false));
+}
+
void RenderView::setStatusText(const WebString& text) {
}
@@ -3425,6 +3434,10 @@ void RenderView::OnSetZoomLevelForLoadingURL(const GURL& url,
host_zoom_levels_[url] = zoom_level;
}
+void RenderView::OnExitFullscreen() {
+ webview()->exitFullscreen();
+}
+
void RenderView::OnSetPageEncoding(const std::string& encoding_name) {
webview()->setPageEncoding(WebString::fromUTF8(encoding_name));
}
diff --git a/content/renderer/render_view.h b/content/renderer/render_view.h
index c628858..2a907e3 100644
--- a/content/renderer/render_view.h
+++ b/content/renderer/render_view.h
@@ -406,6 +406,8 @@ class RenderView : public RenderWidget,
virtual bool supportsFullscreen();
virtual void enterFullscreenForNode(const WebKit::WebNode&);
virtual void exitFullscreenForNode(const WebKit::WebNode&);
+ virtual void enterFullscreen() OVERRIDE;
+ virtual void exitFullscreen() OVERRIDE;
virtual void setStatusText(const WebKit::WebString& text);
virtual void setMouseOverURL(const WebKit::WebURL& url);
virtual void setKeyboardFocusURL(const WebKit::WebURL& url);
@@ -849,6 +851,7 @@ class RenderView : public RenderWidget,
#endif
void OnSetZoomLevel(double zoom_level);
void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level);
+ void OnExitFullscreen();
void OnShouldClose();
void OnStop();
void OnStopFinding(const ViewMsg_StopFinding_Params& params);