| OLD | NEW |
| 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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 | 919 |
| 920 void BrowserWindowGtk::EnterFullscreen( | 920 void BrowserWindowGtk::EnterFullscreen( |
| 921 const GURL& url, FullscreenExitBubbleType type) { | 921 const GURL& url, FullscreenExitBubbleType type) { |
| 922 // gtk_window_(un)fullscreen asks the window manager to toggle the EWMH | 922 // gtk_window_(un)fullscreen asks the window manager to toggle the EWMH |
| 923 // for fullscreen windows. Not all window managers support this. | 923 // for fullscreen windows. Not all window managers support this. |
| 924 gtk_window_fullscreen(window_); | 924 gtk_window_fullscreen(window_); |
| 925 fullscreen_exit_bubble_type_ = type; | 925 fullscreen_exit_bubble_type_ = type; |
| 926 } | 926 } |
| 927 | 927 |
| 928 void BrowserWindowGtk::UpdateFullscreenExitBubbleContent( | 928 void BrowserWindowGtk::UpdateFullscreenExitBubbleContent( |
| 929 const GURL& url, | 929 const GURL& url, |
| 930 FullscreenExitBubbleType bubble_type) { | 930 FullscreenExitBubbleType bubble_type) { |
| 931 if (fullscreen_exit_bubble_.get()) | 931 if (bubble_type == FEB_TYPE_NONE) { |
| 932 fullscreen_exit_bubble_->UpdateContent(url, bubble_type); | 932 fullscreen_exit_bubble_.reset(); |
| 933 } else if (fullscreen_exit_bubble_.get()) { |
| 934 fullscreen_exit_bubble_->UpdateContent(url, bubble_type); |
| 935 } else { |
| 936 fullscreen_exit_bubble_.reset(new FullscreenExitBubbleGtk( |
| 937 GTK_FLOATING_CONTAINER(render_area_floating_container_), |
| 938 browser(), |
| 939 url, |
| 940 bubble_type)); |
| 941 } |
| 933 } | 942 } |
| 934 | 943 |
| 935 void BrowserWindowGtk::ExitFullscreen() { | 944 void BrowserWindowGtk::ExitFullscreen() { |
| 936 // Work around a bug where if we try to unfullscreen, metacity immediately | 945 // Work around a bug where if we try to unfullscreen, metacity immediately |
| 937 // fullscreens us again. This is a little flickery and not necessary if | 946 // fullscreens us again. This is a little flickery and not necessary if |
| 938 // there's a gnome-panel, but it's not easy to detect whether there's a | 947 // there's a gnome-panel, but it's not easy to detect whether there's a |
| 939 // panel or not. | 948 // panel or not. |
| 940 bool unmaximize_before_unfullscreen = IsMaximized() && | 949 bool unmaximize_before_unfullscreen = IsMaximized() && |
| 941 ui::GuessWindowManager() == ui::WM_METACITY; | 950 ui::GuessWindowManager() == ui::WM_METACITY; |
| 942 if (unmaximize_before_unfullscreen) | 951 if (unmaximize_before_unfullscreen) |
| (...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2586 wm_type == ui::WM_OPENBOX || | 2595 wm_type == ui::WM_OPENBOX || |
| 2587 wm_type == ui::WM_XFWM4); | 2596 wm_type == ui::WM_XFWM4); |
| 2588 } | 2597 } |
| 2589 | 2598 |
| 2590 // static | 2599 // static |
| 2591 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2600 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 2592 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2601 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
| 2593 browser_window_gtk->Init(); | 2602 browser_window_gtk->Init(); |
| 2594 return browser_window_gtk; | 2603 return browser_window_gtk; |
| 2595 } | 2604 } |
| OLD | NEW |