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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 198413003: Enable immersive fullscreen on Windows Ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some issues with shelf visibility and desktop fullscreen. Created 6 years, 9 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/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 140fc59fc475da954a5fa6eb1270ebd459b7c287..26cb42931f23f3531a9087c79b6b3c03b1782468 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -929,14 +929,14 @@ void BrowserView::EnterFullscreen(
if (IsFullscreen())
return; // Nothing to do.
- ProcessFullscreen(true, FOR_DESKTOP, url, bubble_type);
+ ProcessFullscreen(true, NORMAL_FULLSCREEN, url, bubble_type);
}
void BrowserView::ExitFullscreen() {
if (!IsFullscreen())
return; // Nothing to do.
- ProcessFullscreen(false, FOR_DESKTOP, GURL(), FEB_TYPE_NONE);
+ ProcessFullscreen(false, NORMAL_FULLSCREEN, GURL(), FEB_TYPE_NONE);
}
void BrowserView::UpdateFullscreenExitBubbleContent(
@@ -974,7 +974,7 @@ bool BrowserView::IsFullscreenBubbleVisible() const {
#if defined(OS_WIN)
void BrowserView::SetMetroSnapMode(bool enable) {
HISTOGRAM_COUNTS("Metro.SnapModeToggle", enable);
- ProcessFullscreen(enable, FOR_METRO, GURL(), FEB_TYPE_NONE);
+ ProcessFullscreen(enable, METRO_SNAP_FULLSCREEN, GURL(), FEB_TYPE_NONE);
}
bool BrowserView::IsInMetroSnapMode() const {
@@ -996,7 +996,7 @@ void BrowserView::SetWindowSwitcherButton(views::Button* button) {
void BrowserView::FullscreenStateChanged() {
CHECK(!IsFullscreen());
- ProcessFullscreen(false, FOR_DESKTOP, GURL(), FEB_TYPE_NONE);
+ ProcessFullscreen(false, NORMAL_FULLSCREEN, GURL(), FEB_TYPE_NONE);
}
void BrowserView::ToolbarSizeChanged(bool is_animating) {
@@ -2189,7 +2189,7 @@ void BrowserView::UpdateUIForContents(WebContents* contents) {
}
void BrowserView::ProcessFullscreen(bool fullscreen,
- FullscreenType type,
+ FullscreenMode mode,
const GURL& url,
FullscreenExitBubbleType bubble_type) {
if (in_process_fullscreen_)
@@ -2202,7 +2202,7 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
// thus are slow and look ugly (enforced via |in_process_fullscreen_|).
LocationBarView* location_bar = GetLocationBarView();
- if (type == FOR_METRO || !fullscreen) {
+ if (mode == METRO_SNAP_FULLSCREEN || !fullscreen) {
// Hide the fullscreen bubble as soon as possible, since the mode toggle can
// take enough time for the user to notice.
fullscreen_bubble_.reset();
@@ -2221,13 +2221,15 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
frame_->SetFullscreen(fullscreen);
// Enable immersive before the browser refreshes its list of enabled commands.
- if (ShouldUseImmersiveFullscreenForUrl(url))
+ if (mode != METRO_SNAP_FULLSCREEN && ShouldUseImmersiveFullscreenForUrl(url))
immersive_mode_controller_->SetEnabled(fullscreen);
browser_->WindowFullscreenStateChanged();
- if (fullscreen && !chrome::IsRunningInAppMode() && type != FOR_METRO)
+ if (fullscreen && !chrome::IsRunningInAppMode() &&
+ mode != METRO_SNAP_FULLSCREEN) {
UpdateFullscreenExitBubbleContent(url, bubble_type);
+ }
// Undo our anti-jankiness hacks and force a re-layout. We also need to
// recompute the height of the infobar top arrow because toggling in and out
@@ -2244,14 +2246,19 @@ bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const {
// Kiosk mode needs the whole screen.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode))
return false;
- bool is_browser_fullscreen = url.is_empty();
- if (ash::switches::UseImmersiveFullscreenForAllWindows())
- return is_browser_fullscreen;
- else
- return is_browser_fullscreen && IsBrowserTypeNormal();
-#else
- return false;
#endif
+
+#if defined(USE_ASH)
+ if (browser()->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) {
+ bool is_browser_fullscreen = url.is_empty();
+ if (ash::switches::UseImmersiveFullscreenForAllWindows())
+ return is_browser_fullscreen;
+ else
sky 2014/03/13 22:08:25 nit: style says no else after a return.
+ return is_browser_fullscreen && IsBrowserTypeNormal();
+ }
+#endif
+
+ return false;
}
void BrowserView::LoadAccelerators() {

Powered by Google App Engine
This is Rietveld 408576698