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

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 issues from previous review comment. 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 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() {
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/frame/immersive_mode_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698