summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/app_controller_mac.mm26
-rw-r--r--chrome/browser/cocoa/browser_window_controller.h4
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm19
3 files changed, 0 insertions, 49 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index f2d1b2a..c56aa46 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -125,34 +125,8 @@
}
}
-// Checks if there are any tabs with sheets open, and if so, raises one of
-// the tabs with a sheet and returns NO.
-- (BOOL)shouldQuitWithOpenPerTabSheets {
- BrowserList::const_iterator it = BrowserList::begin();
- for (; it != BrowserList::end(); ++it) {
- Browser* browser = *it;
- BrowserWindowCocoa* window =
- static_cast<BrowserWindowCocoa*>(browser->window());
-
- // Could do this more nicely with a method e.g. on BWC. If I decide for
- // keeping it this way, at least add a DCHECK().
- BrowserWindowController* controller =
- (BrowserWindowController*)[window->GetNativeHandle() windowController];
-
- if (![controller shouldCloseWithOpenPerTabSheets])
- return NO;
- }
-
- return YES;
-}
-
- (NSApplicationTerminateReply)applicationShouldTerminate:
(NSApplication *)sender {
- // Do not quit if any per-tab sheets are open, as required by
- // GTMWindowSheetController.
- if (![self shouldQuitWithOpenPerTabSheets])
- return NSTerminateCancel;
-
// Check for in-progress downloads, and prompt the user if they really want to
// quit (and thus cancel the downloads).
if (![self shouldQuitWithInProgressDownloads])
diff --git a/chrome/browser/cocoa/browser_window_controller.h b/chrome/browser/cocoa/browser_window_controller.h
index 339aa61..b4700b4 100644
--- a/chrome/browser/cocoa/browser_window_controller.h
+++ b/chrome/browser/cocoa/browser_window_controller.h
@@ -150,10 +150,6 @@ class TabStripModelObserverBridge;
// for the per-tab sheets.
- (GTMWindowSheetController*)sheetController;
-// Checks if there are any tabs with sheets open, and if so, raises one of
-// the tabs with a sheet and returns NO.
-- (BOOL)shouldCloseWithOpenPerTabSheets;
-
- (void)attachConstrainedWindow:(ConstrainedWindowMac*)window;
- (void)removeConstrainedWindow:(ConstrainedWindowMac*)window;
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index 95fc140..32dd545 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -267,20 +267,6 @@ willPositionSheet:(NSWindow*)sheet
afterDelay:0];
}
-// Checks if there are any tabs with sheets open, and if so, raises one of
-// the tabs with a sheet and returns NO.
-- (BOOL)shouldCloseWithOpenPerTabSheets {
- // This is O(n_open_sheets * n_tabs), i.e. O(n**2). Since people probably
- // won't have 100 tabs open, and not every tab will have a sheet, this is ok.
- for (NSView* view in
- [[tabStripController_ sheetController] viewsWithAttachedSheets]) {
- [tabStripController_ gtm_systemRequestsVisibilityForView:view];
- return NO;
- }
-
- return YES;
-}
-
- (void)attachConstrainedWindow:(ConstrainedWindowMac*)window {
[tabStripController_ attachConstrainedWindow:window];
}
@@ -296,11 +282,6 @@ willPositionSheet:(NSWindow*)sheet
// required to get us to the closing state and (by watching for all the tabs
// going away) will again call to close the window when it's finally ready.
- (BOOL)windowShouldClose:(id)sender {
- // Do not close a window with open sheets, as required by
- // GTMWindowSheetController.
- if (![self shouldCloseWithOpenPerTabSheets])
- return NO;
-
// Disable updates while closing all tabs to avoid flickering.
base::ScopedNSDisableScreenUpdates disabler;
// Give beforeunload handlers the chance to cancel the close before we hide