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

Side by Side Diff: chrome/browser/ui/gtk/browser_window_gtk.cc

Issue 10261011: Windowed mode mouse lock addded to fullscreen controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yzshen feedback addressed. Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
6 6
7 #include <dlfcn.h> 7 #include <dlfcn.h>
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 915
916 void BrowserWindowGtk::EnterFullscreen( 916 void BrowserWindowGtk::EnterFullscreen(
917 const GURL& url, FullscreenExitBubbleType type) { 917 const GURL& url, FullscreenExitBubbleType type) {
918 // gtk_window_(un)fullscreen asks the window manager to toggle the EWMH 918 // gtk_window_(un)fullscreen asks the window manager to toggle the EWMH
919 // for fullscreen windows. Not all window managers support this. 919 // for fullscreen windows. Not all window managers support this.
920 gtk_window_fullscreen(window_); 920 gtk_window_fullscreen(window_);
921 fullscreen_exit_bubble_type_ = type; 921 fullscreen_exit_bubble_type_ = type;
922 } 922 }
923 923
924 void BrowserWindowGtk::UpdateFullscreenExitBubbleContent( 924 void BrowserWindowGtk::UpdateFullscreenExitBubbleContent(
925 const GURL& url, 925 const GURL& url,
926 FullscreenExitBubbleType bubble_type) { 926 FullscreenExitBubbleType bubble_type) {
927 if (fullscreen_exit_bubble_.get()) 927 if (bubble_type == FEB_TYPE_NONE) {
928 fullscreen_exit_bubble_->UpdateContent(url, bubble_type); 928 fullscreen_exit_bubble_.reset();
929 } else if (fullscreen_exit_bubble_.get()) {
930 fullscreen_exit_bubble_->UpdateContent(url, bubble_type);
931 } else {
932 fullscreen_exit_bubble_.reset(new FullscreenExitBubbleGtk(
933 GTK_FLOATING_CONTAINER(render_area_floating_container_),
934 browser(),
935 url,
936 bubble_type));
937 }
929 } 938 }
930 939
931 void BrowserWindowGtk::ExitFullscreen() { 940 void BrowserWindowGtk::ExitFullscreen() {
932 // Work around a bug where if we try to unfullscreen, metacity immediately 941 // Work around a bug where if we try to unfullscreen, metacity immediately
933 // fullscreens us again. This is a little flickery and not necessary if 942 // fullscreens us again. This is a little flickery and not necessary if
934 // there's a gnome-panel, but it's not easy to detect whether there's a 943 // there's a gnome-panel, but it's not easy to detect whether there's a
935 // panel or not. 944 // panel or not.
936 bool unmaximize_before_unfullscreen = IsMaximized() && 945 bool unmaximize_before_unfullscreen = IsMaximized() &&
937 ui::GuessWindowManager() == ui::WM_METACITY; 946 ui::GuessWindowManager() == ui::WM_METACITY;
938 if (unmaximize_before_unfullscreen) 947 if (unmaximize_before_unfullscreen)
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
2583 wm_type == ui::WM_OPENBOX || 2592 wm_type == ui::WM_OPENBOX ||
2584 wm_type == ui::WM_XFWM4); 2593 wm_type == ui::WM_XFWM4);
2585 } 2594 }
2586 2595
2587 // static 2596 // static
2588 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { 2597 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
2589 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); 2598 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser);
2590 browser_window_gtk->Init(); 2599 browser_window_gtk->Init();
2591 return browser_window_gtk; 2600 return browser_window_gtk;
2592 } 2601 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698