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

Side by Side Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 2952004: [Mac] Finish implementation of App Tabs. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 | Annotate | Revision Log
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 #import "chrome/browser/cocoa/browser_window_controller.h" 5 #import "chrome/browser/cocoa/browser_window_controller.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 8
9 #include "app/l10n_util_mac.h" 9 #include "app/l10n_util_mac.h"
10 #include "base/mac_util.h" 10 #include "base/mac_util.h"
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 // TODO(rohitrao): Determine if calling setFrame: twice is bad. 786 // TODO(rohitrao): Determine if calling setFrame: twice is bad.
787 [view setFrame:frame]; 787 [view setFrame:frame];
788 [self layoutSubviews]; 788 [self layoutSubviews];
789 } 789 }
790 790
791 - (void)setAnimationInProgress:(BOOL)inProgress { 791 - (void)setAnimationInProgress:(BOOL)inProgress {
792 [[self tabContentArea] setFastResizeMode:inProgress]; 792 [[self tabContentArea] setFastResizeMode:inProgress];
793 } 793 }
794 794
795 // Update a toggle state for an NSMenuItem if modified. 795 // Update a toggle state for an NSMenuItem if modified.
796 // Take care to insure |item| looks like a NSMenuItem. 796 // Take care to ensure |item| looks like a NSMenuItem.
797 // Called by validateUserInterfaceItem:. 797 // Called by validateUserInterfaceItem:.
798 - (void)updateToggleStateWithTag:(NSInteger)tag forItem:(id)item { 798 - (void)updateToggleStateWithTag:(NSInteger)tag forItem:(id)item {
799 if (![item respondsToSelector:@selector(state)] || 799 if (![item respondsToSelector:@selector(state)] ||
800 ![item respondsToSelector:@selector(setState:)]) 800 ![item respondsToSelector:@selector(setState:)])
801 return; 801 return;
802 802
803 // On Windows this logic happens in bookmark_bar_view.cc. On the 803 // On Windows this logic happens in bookmark_bar_view.cc. On the
804 // Mac we're a lot more MVC happy so we've moved it into a 804 // Mac we're a lot more MVC happy so we've moved it into a
805 // controller. To be clear, this simply updates the menu item; it 805 // controller. To be clear, this simply updates the menu item; it
806 // does not display the bookmark bar itself. 806 // does not display the bookmark bar itself.
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 // tab strip mode. 1626 // tab strip mode.
1627 - (void)toggleTabStripDisplayMode { 1627 - (void)toggleTabStripDisplayMode {
1628 [super toggleTabStripDisplayMode]; 1628 [super toggleTabStripDisplayMode];
1629 [self createTabStripController]; 1629 [self createTabStripController];
1630 } 1630 }
1631 1631
1632 - (BOOL)useVerticalTabs { 1632 - (BOOL)useVerticalTabs {
1633 return browser_->tabstrip_model()->delegate()->UseVerticalTabs(); 1633 return browser_->tabstrip_model()->delegate()->UseVerticalTabs();
1634 } 1634 }
1635 1635
1636 - (void)setToolbarCollapsedMode:(BOOL)collapsed {
1637 if (toolbarCollapsed_ == collapsed)
1638 return;
1639
1640 static_cast<LocationBarViewMac*>([self locationBarBridge])->
1641 SetEditable(!collapsed);
1642
1643 // TODO(andybons): Actually hide toolbar if collapsed.
1644
1645 toolbarCollapsed_ = collapsed;
1646 }
1647
1648 - (void)sheetDidEnd:(NSWindow*)sheet 1636 - (void)sheetDidEnd:(NSWindow*)sheet
1649 returnCode:(NSInteger)code 1637 returnCode:(NSInteger)code
1650 context:(void*)context { 1638 context:(void*)context {
1651 [sheet orderOut:self]; 1639 [sheet orderOut:self];
1652 } 1640 }
1653 1641
1654 @end // @implementation BrowserWindowController 1642 @end // @implementation BrowserWindowController
1655 1643
1656 1644
1657 @implementation BrowserWindowController(Fullscreen) 1645 @implementation BrowserWindowController(Fullscreen)
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 1860
1873 - (BOOL)supportsBookmarkBar { 1861 - (BOOL)supportsBookmarkBar {
1874 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 1862 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
1875 } 1863 }
1876 1864
1877 - (BOOL)isNormalWindow { 1865 - (BOOL)isNormalWindow {
1878 return browser_->type() == Browser::TYPE_NORMAL; 1866 return browser_->type() == Browser::TYPE_NORMAL;
1879 } 1867 }
1880 1868
1881 @end // @implementation BrowserWindowController(WindowType) 1869 @end // @implementation BrowserWindowController(WindowType)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698