OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <numeric> | 8 #include <numeric> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 // the window below. | 580 // the window below. |
581 if (!browser_->ShouldCloseWindow()) | 581 if (!browser_->ShouldCloseWindow()) |
582 return NO; | 582 return NO; |
583 | 583 |
584 // saveWindowPositionIfNeeded: only works if we are the last active | 584 // saveWindowPositionIfNeeded: only works if we are the last active |
585 // window, but orderOut: ends up activating another window, so we | 585 // window, but orderOut: ends up activating another window, so we |
586 // have to save the window position before we call orderOut:. | 586 // have to save the window position before we call orderOut:. |
587 [self saveWindowPositionIfNeeded]; | 587 [self saveWindowPositionIfNeeded]; |
588 | 588 |
589 bool fast_tab_closing_enabled = | 589 bool fast_tab_closing_enabled = |
590 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableFastUnload); | 590 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 591 switches::kEnableFastUnload); |
591 | 592 |
592 if (!browser_->tab_strip_model()->empty()) { | 593 if (!browser_->tab_strip_model()->empty()) { |
593 // Tab strip isn't empty. Hide the frame (so it appears to have closed | 594 // Tab strip isn't empty. Hide the frame (so it appears to have closed |
594 // immediately) and close all the tabs, allowing the renderers to shut | 595 // immediately) and close all the tabs, allowing the renderers to shut |
595 // down. When the tab strip is empty we'll be called back again. | 596 // down. When the tab strip is empty we'll be called back again. |
596 [[self window] orderOut:self]; | 597 [[self window] orderOut:self]; |
597 browser_->OnWindowClosing(); | 598 browser_->OnWindowClosing(); |
598 if (fast_tab_closing_enabled) | 599 if (fast_tab_closing_enabled) |
599 browser_->tab_strip_model()->CloseAllTabs(); | 600 browser_->tab_strip_model()->CloseAllTabs(); |
600 return NO; | 601 return NO; |
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 | 2224 |
2224 - (BOOL)supportsBookmarkBar { | 2225 - (BOOL)supportsBookmarkBar { |
2225 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2226 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2226 } | 2227 } |
2227 | 2228 |
2228 - (BOOL)isTabbedWindow { | 2229 - (BOOL)isTabbedWindow { |
2229 return browser_->is_type_tabbed(); | 2230 return browser_->is_type_tabbed(); |
2230 } | 2231 } |
2231 | 2232 |
2232 @end // @implementation BrowserWindowController(WindowType) | 2233 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |