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

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

Issue 2821011: Removes phantom tabs. (Closed)
Patch Set: Created 10 years, 6 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/gtk/browser_window_gtk.h" 5 #include "chrome/browser/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 // You cannot close a frame for which there is an active originating drag 1346 // You cannot close a frame for which there is an active originating drag
1347 // session. 1347 // session.
1348 if (tabstrip_->IsDragSessionActive()) 1348 if (tabstrip_->IsDragSessionActive())
1349 return false; 1349 return false;
1350 1350
1351 // Give beforeunload handlers the chance to cancel the close before we hide 1351 // Give beforeunload handlers the chance to cancel the close before we hide
1352 // the window below. 1352 // the window below.
1353 if (!browser_->ShouldCloseWindow()) 1353 if (!browser_->ShouldCloseWindow())
1354 return false; 1354 return false;
1355 1355
1356 if (browser_->tabstrip_model()->HasNonPhantomTabs()) { 1356 if (!browser_->tabstrip_model()->empty()) {
1357 // Tab strip isn't empty. Hide the window (so it appears to have closed 1357 // Tab strip isn't empty. Hide the window (so it appears to have closed
1358 // immediately) and close all the tabs, allowing the renderers to shut 1358 // immediately) and close all the tabs, allowing the renderers to shut
1359 // down. When the tab strip is empty we'll be called back again. 1359 // down. When the tab strip is empty we'll be called back again.
1360 gtk_widget_hide(GTK_WIDGET(window_)); 1360 gtk_widget_hide(GTK_WIDGET(window_));
1361 browser_->OnWindowClosing(); 1361 browser_->OnWindowClosing();
1362 return false; 1362 return false;
1363 } 1363 }
1364 1364
1365 // Empty TabStripModel, it's now safe to allow the Window to be closed. 1365 // Empty TabStripModel, it's now safe to allow the Window to be closed.
1366 NotificationService::current()->Notify( 1366 NotificationService::current()->Notify(
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 // special-case the ones where the custom frame should be used. These names 2125 // special-case the ones where the custom frame should be used. These names
2126 // are taken from the WMs' source code. 2126 // are taken from the WMs' source code.
2127 return (wm_name == "Blackbox" || 2127 return (wm_name == "Blackbox" ||
2128 wm_name == "compiz" || 2128 wm_name == "compiz" ||
2129 wm_name == "e16" || // Enlightenment DR16 2129 wm_name == "e16" || // Enlightenment DR16
2130 wm_name == "Metacity" || 2130 wm_name == "Metacity" ||
2131 wm_name == "Mutter" || 2131 wm_name == "Mutter" ||
2132 wm_name == "Openbox" || 2132 wm_name == "Openbox" ||
2133 wm_name == "Xfwm4"); 2133 wm_name == "Xfwm4");
2134 } 2134 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module_constants.cc ('k') | chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698