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

Side by Side Diff: chrome/browser/views/frame/browser_view.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/views/frame/browser_view.h" 5 #include "chrome/browser/views/frame/browser_view.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 // You cannot close a frame for which there is an active originating drag 1547 // You cannot close a frame for which there is an active originating drag
1548 // session. 1548 // session.
1549 if (tabstrip_->IsDragSessionActive()) 1549 if (tabstrip_->IsDragSessionActive())
1550 return false; 1550 return false;
1551 1551
1552 // Give beforeunload handlers the chance to cancel the close before we hide 1552 // Give beforeunload handlers the chance to cancel the close before we hide
1553 // the window below. 1553 // the window below.
1554 if (!browser_->ShouldCloseWindow()) 1554 if (!browser_->ShouldCloseWindow())
1555 return false; 1555 return false;
1556 1556
1557 if (browser_->tabstrip_model()->HasNonPhantomTabs()) { 1557 if (!browser_->tabstrip_model()->empty()) {
1558 // Tab strip isn't empty. Hide the frame (so it appears to have closed 1558 // Tab strip isn't empty. Hide the frame (so it appears to have closed
1559 // immediately) and close all the tabs, allowing the renderers to shut 1559 // immediately) and close all the tabs, allowing the renderers to shut
1560 // down. When the tab strip is empty we'll be called back again. 1560 // down. When the tab strip is empty we'll be called back again.
1561 frame_->GetWindow()->HideWindow(); 1561 frame_->GetWindow()->HideWindow();
1562 browser_->OnWindowClosing(); 1562 browser_->OnWindowClosing();
1563 return false; 1563 return false;
1564 } 1564 }
1565 1565
1566 // Empty TabStripModel, it's now safe to allow the Window to be closed. 1566 // Empty TabStripModel, it's now safe to allow the Window to be closed.
1567 NotificationService::current()->Notify( 1567 NotificationService::current()->Notify(
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
2232 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); 2232 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME));
2233 2233
2234 return view; 2234 return view;
2235 } 2235 }
2236 #endif 2236 #endif
2237 2237
2238 // static 2238 // static
2239 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2239 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2240 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2240 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2241 } 2241 }
OLDNEW
« no previous file with comments | « chrome/browser/tabs/tab_strip_model_unittest.cc ('k') | chrome/browser/views/tabs/browser_tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698