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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 [[self window] orderOut:self]; | 602 [[self window] orderOut:self]; |
603 return NO; | 603 return NO; |
604 } | 604 } |
605 | 605 |
606 // the tab strip is empty, it's ok to close the window | 606 // the tab strip is empty, it's ok to close the window |
607 return YES; | 607 return YES; |
608 } | 608 } |
609 | 609 |
610 // Called right after our window became the main window. | 610 // Called right after our window became the main window. |
611 - (void)windowDidBecomeMain:(NSNotification*)notification { | 611 - (void)windowDidBecomeMain:(NSNotification*)notification { |
612 if (chrome::GetLastActiveBrowser() != browser_) { | 612 if (chrome::GetLastActiveBrowser() != browser_.get()) { |
613 BrowserList::SetLastActive(browser_.get()); | 613 BrowserList::SetLastActive(browser_.get()); |
614 } | 614 } |
615 // Always saveWindowPositionIfNeeded when becoming main, not just | 615 // Always saveWindowPositionIfNeeded when becoming main, not just |
616 // when |browser_| is not the last active browser. See crbug.com/536280 . | 616 // when |browser_| is not the last active browser. See crbug.com/536280 . |
617 [self saveWindowPositionIfNeeded]; | 617 [self saveWindowPositionIfNeeded]; |
618 | 618 |
619 NSView* rootView = [[[self window] contentView] superview]; | 619 NSView* rootView = [[[self window] contentView] superview]; |
620 [rootView cr_recursivelyInvokeBlock:^(id view) { | 620 [rootView cr_recursivelyInvokeBlock:^(id view) { |
621 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)]) | 621 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)]) |
622 [view windowDidChangeActive]; | 622 [view windowDidChangeActive]; |
(...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2078 | 2078 |
2079 - (BOOL)supportsBookmarkBar { | 2079 - (BOOL)supportsBookmarkBar { |
2080 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2080 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2081 } | 2081 } |
2082 | 2082 |
2083 - (BOOL)isTabbedWindow { | 2083 - (BOOL)isTabbedWindow { |
2084 return browser_->is_type_tabbed(); | 2084 return browser_->is_type_tabbed(); |
2085 } | 2085 } |
2086 | 2086 |
2087 @end // @implementation BrowserWindowController(WindowType) | 2087 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |