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 c91590da652bb757ee0ef4e38ff42f0d47480ba3..edea25f8910c7aca9a0c4d6ff4f6d4ea8c2d279a 100644 |
--- a/chrome/browser/ui/views/frame/browser_view.cc |
+++ b/chrome/browser/ui/views/frame/browser_view.cc |
@@ -913,14 +913,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( |
@@ -958,7 +958,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 { |
@@ -980,7 +980,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) { |
@@ -2173,7 +2173,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_) |
@@ -2186,7 +2186,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(); |
@@ -2205,13 +2205,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 |
@@ -2224,15 +2226,14 @@ void BrowserView::ProcessFullscreen(bool fullscreen, |
} |
bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { |
-#if defined(OS_CHROMEOS) |
- // Kiosk mode needs the whole screen. |
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
+ // Kiosk mode needs the whole screen, and if we're not in an Ash desktop |
+ // immersive fullscreen doesn't exist. |
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode) || |
+ browser()->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH) { |
return false; |
- bool is_browser_fullscreen = url.is_empty(); |
- return is_browser_fullscreen; |
-#else |
- return false; |
-#endif |
+ } |
+ |
+ return url.is_empty(); |
} |
void BrowserView::LoadAccelerators() { |