diff options
-rw-r--r-- | chrome/app/nibs/BrowserWindow.xib | 630 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/browser_window_controller.mm | 31 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/browser_window_controller_private.mm | 7 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/framed_browser_window.h | 4 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/framed_browser_window.mm | 63 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/framed_browser_window_unittest.mm | 15 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/tabs/tab_strip_view.h | 3 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/tabs/tab_strip_view.mm | 11 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/tabs/tab_window_controller.h | 17 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/tabs/tab_window_controller.mm | 67 | ||||
-rw-r--r-- | chrome/chrome_nibs.gypi | 1 |
11 files changed, 103 insertions, 746 deletions
diff --git a/chrome/app/nibs/BrowserWindow.xib b/chrome/app/nibs/BrowserWindow.xib deleted file mode 100644 index 7bd6a5a..0000000 --- a/chrome/app/nibs/BrowserWindow.xib +++ /dev/null @@ -1,630 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> - <data> - <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">12B19</string> - <string key="IBDocument.InterfaceBuilderVersion">2549</string> - <string key="IBDocument.AppKitVersion">1187</string> - <string key="IBDocument.HIToolboxVersion">624.00</string> - <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> - <string key="NS.object.0">2549</string> - </object> - <object class="NSArray" key="IBDocument.IntegratedClassDependencies"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>NSButton</string> - <string>NSButtonCell</string> - <string>NSCustomObject</string> - <string>NSCustomView</string> - <string>NSView</string> - <string>NSWindowTemplate</string> - </object> - <object class="NSArray" key="IBDocument.PluginDependencies"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - </object> - <object class="NSMutableDictionary" key="IBDocument.Metadata"> - <string key="NS.key.0">PluginDependencyRecalculationVersion</string> - <integer value="1" key="NS.object.0"/> - </object> - <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSCustomObject" id="1001"> - <string key="NSClassName">BrowserWindowController</string> - </object> - <object class="NSCustomObject" id="1003"> - <string key="NSClassName">FirstResponder</string> - </object> - <object class="NSCustomObject" id="1004"> - <string key="NSClassName">NSApplication</string> - </object> - <object class="NSWindowTemplate" id="1005"> - <int key="NSWindowStyleMask">4367</int> - <int key="NSWindowBacking">2</int> - <string key="NSWindowRect">{{60, 229}, {750, 600}}</string> - <int key="NSWTFlags">536872960</int> - <string key="NSWindowTitle"/> - <string key="NSWindowClass">FramedBrowserWindow</string> - <nil key="NSViewClass"/> - <nil key="NSUserInterfaceItemIdentifier"/> - <object class="NSView" key="NSWindowView" id="1006"> - <reference key="NSNextResponder"/> - <int key="NSvFlags">256</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSCustomView" id="1858870"> - <reference key="NSNextResponder" ref="1006"/> - <int key="NSvFlags">274</int> - <string key="NSFrameSize">{750, 600}</string> - <reference key="NSSuperview" ref="1006"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView"/> - <string key="NSClassName">FastResizeView</string> - </object> - </object> - <string key="NSFrameSize">{750, 600}</string> - <reference key="NSSuperview"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="1858870"/> - </object> - <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> - <string key="NSMaxSize">{10000000000000, 10000000000000}</string> - <bool key="NSWindowIsRestorable">YES</bool> - </object> - <object class="NSCustomView" id="1029219716"> - <nil key="NSNextResponder"/> - <int key="NSvFlags">266</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSButton" id="131944810"> - <reference key="NSNextResponder" ref="1029219716"/> - <int key="NSvFlags">-2147483356</int> - <string key="NSFrame">{{295, 0}, {40, 27}}</string> - <reference key="NSSuperview" ref="1029219716"/> - <bool key="NSEnabled">YES</bool> - <object class="NSButtonCell" key="NSCell" id="517448702"> - <int key="NSCellFlags">-2080374784</int> - <int key="NSCellFlags2">134217728</int> - <string key="NSContents"/> - <object class="NSFont" key="NSSupport"> - <string key="NSName">LucidaGrande</string> - <double key="NSSize">13</double> - <int key="NSfFlags">1044</int> - </object> - <reference key="NSControlView" ref="131944810"/> - <int key="NSButtonFlags">138690560</int> - <int key="NSButtonFlags2">134</int> - <string key="NSAlternateContents"/> - <string key="NSKeyEquivalent"/> - <int key="NSPeriodicDelay">400</int> - <int key="NSPeriodicInterval">75</int> - </object> - <bool key="NSAllowsLogicalLayoutDirection">NO</bool> - </object> - </object> - <string key="NSFrameSize">{483, 37}</string> - <string key="NSClassName">TabStripView</string> - </object> - <object class="NSCustomObject" id="353122276"> - <string key="NSClassName">ChromeUILocalizer</string> - </object> - </object> - <object class="IBObjectContainer" key="IBDocument.Objects"> - <object class="NSMutableArray" key="connectionRecords"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">window</string> - <reference key="source" ref="1001"/> - <reference key="destination" ref="1005"/> - </object> - <int key="connectionID">13</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">tabContentArea_</string> - <reference key="source" ref="1001"/> - <reference key="destination" ref="1858870"/> - </object> - <int key="connectionID">86</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">tabStripView_</string> - <reference key="source" ref="1001"/> - <reference key="destination" ref="1029219716"/> - </object> - <int key="connectionID">88</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">delegate</string> - <reference key="source" ref="1005"/> - <reference key="destination" ref="1001"/> - </object> - <int key="connectionID">35</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">newTabButton</string> - <reference key="source" ref="1029219716"/> - <reference key="destination" ref="131944810"/> - </object> - <int key="connectionID">87</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">owner_</string> - <reference key="source" ref="353122276"/> - <reference key="destination" ref="1001"/> - </object> - <int key="connectionID">110</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">otherObjectToLocalize_</string> - <reference key="source" ref="353122276"/> - <reference key="destination" ref="1029219716"/> - </object> - <int key="connectionID">111</int> - </object> - </object> - <object class="IBMutableOrderedSet" key="objectRecords"> - <object class="NSArray" key="orderedObjects"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBObjectRecord"> - <int key="objectID">0</int> - <object class="NSArray" key="object" id="0"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> - <reference key="children" ref="1000"/> - <nil key="parent"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">-2</int> - <reference key="object" ref="1001"/> - <reference key="parent" ref="0"/> - <string key="objectName">File's Owner</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">-1</int> - <reference key="object" ref="1003"/> - <reference key="parent" ref="0"/> - <string key="objectName">First Responder</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">-3</int> - <reference key="object" ref="1004"/> - <reference key="parent" ref="0"/> - <string key="objectName">Application</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">1</int> - <reference key="object" ref="1005"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="1006"/> - </object> - <reference key="parent" ref="0"/> - <string key="objectName">Browser</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">2</int> - <reference key="object" ref="1006"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="1858870"/> - </object> - <reference key="parent" ref="1005"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">56</int> - <reference key="object" ref="1029219716"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="131944810"/> - </object> - <reference key="parent" ref="0"/> - <string key="objectName">TabBar</string> - </object> - <object class="IBObjectRecord"> - <int key="objectID">66</int> - <reference key="object" ref="131944810"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="517448702"/> - </object> - <reference key="parent" ref="1029219716"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">67</int> - <reference key="object" ref="517448702"/> - <reference key="parent" ref="131944810"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">84</int> - <reference key="object" ref="1858870"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> - <reference key="parent" ref="1006"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">109</int> - <reference key="object" ref="353122276"/> - <reference key="parent" ref="0"/> - </object> - </object> - </object> - <object class="NSMutableDictionary" key="flattenedProperties"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>-1.IBPluginDependency</string> - <string>-2.IBPluginDependency</string> - <string>-3.IBPluginDependency</string> - <string>1.IBPluginDependency</string> - <string>1.IBWindowTemplateEditedContentRect</string> - <string>1.NSWindowTemplate.visibleAtLaunch</string> - <string>109.IBPluginDependency</string> - <string>2.IBPluginDependency</string> - <string>2.IBViewIntegration.shadowBlurRadius</string> - <string>2.IBViewIntegration.shadowColor</string> - <string>2.IBViewIntegration.shadowOffsetHeight</string> - <string>2.IBViewIntegration.shadowOffsetWidth</string> - <string>56.IBPluginDependency</string> - <string>66.CustomClassName</string> - <string>66.IBAttributePlaceholdersKey</string> - <string>66.IBPluginDependency</string> - <string>67.CustomClassName</string> - <string>67.IBPluginDependency</string> - <string>84.IBPluginDependency</string> - </object> - <object class="NSArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{466, 406}, {750, 600}}</string> - <boolean value="NO"/> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <real value="0.0"/> - <object class="NSColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MAA</bytes> - </object> - <real value="0.0"/> - <real value="0.0"/> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>NewTabButton</string> - <object class="NSMutableDictionary"> - <string key="NS.key.0">ToolTip</string> - <object class="IBToolTipAttribute" key="NS.object.0"> - <string key="name">ToolTip</string> - <reference key="object" ref="131944810"/> - <string key="toolTip">^IDS_TOOLTIP_NEW_TAB</string> - </object> - </object> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>NewTabButtonCell</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - </object> - </object> - <object class="NSMutableDictionary" key="unlocalizedProperties"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference key="dict.sortedKeys" ref="0"/> - <reference key="dict.values" ref="0"/> - </object> - <nil key="activeLocalization"/> - <object class="NSMutableDictionary" key="localizations"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference key="dict.sortedKeys" ref="0"/> - <reference key="dict.values" ref="0"/> - </object> - <nil key="sourceID"/> - <int key="maxID">111</int> - </object> - <object class="IBClassDescriber" key="IBDocument.Classes"> - <object class="NSMutableArray" key="referencedPartialClassDescriptions"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBPartialClassDescription"> - <string key="className">BrowserWindowController</string> - <string key="superclassName">TabWindowController</string> - <object class="NSMutableDictionary" key="actions"> - <string key="NS.key.0">enterFullscreen:</string> - <string key="NS.object.0">id</string> - </object> - <object class="NSMutableDictionary" key="actionInfosByName"> - <string key="NS.key.0">enterFullscreen:</string> - <object class="IBActionInfo" key="NS.object.0"> - <string key="name">enterFullscreen:</string> - <string key="candidateClassName">id</string> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/BrowserWindowController.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">ChromeBrowserWindow</string> - <string key="superclassName">ChromeEventProcessingWindow</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/ChromeBrowserWindow.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">ChromeEventProcessingWindow</string> - <string key="superclassName">UnderlayOpenGLHostingWindow</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/ChromeEventProcessingWindow.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">ChromeUILocalizer</string> - <string key="superclassName">GTMUILocalizer</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/ChromeUILocalizer.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">FastResizeView</string> - <string key="superclassName">NSView</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/FastResizeView.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">FirstResponder</string> - <object class="NSMutableDictionary" key="actions"> - <string key="NS.key.0">commandDispatch:</string> - <string key="NS.object.0">id</string> - </object> - <object class="NSMutableDictionary" key="actionInfosByName"> - <string key="NS.key.0">commandDispatch:</string> - <object class="IBActionInfo" key="NS.object.0"> - <string key="name">commandDispatch:</string> - <string key="candidateClassName">id</string> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBUserSource</string> - <string key="minorKey"/> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">FramedBrowserWindow</string> - <string key="superclassName">ChromeBrowserWindow</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/FramedBrowserWindow.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">GTMUILocalizer</string> - <string key="superclassName">NSObject</string> - <object class="NSMutableDictionary" key="outlets"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>otherObjectToLocalize_</string> - <string>owner_</string> - <string>yetAnotherObjectToLocalize_</string> - </object> - <object class="NSArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>id</string> - <string>id</string> - <string>id</string> - </object> - </object> - <object class="NSMutableDictionary" key="toOneOutletInfosByName"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>otherObjectToLocalize_</string> - <string>owner_</string> - <string>yetAnotherObjectToLocalize_</string> - </object> - <object class="NSArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBToOneOutletInfo"> - <string key="name">otherObjectToLocalize_</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">owner_</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">yetAnotherObjectToLocalize_</string> - <string key="candidateClassName">id</string> - </object> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/GTMUILocalizer.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">ImageButtonCell</string> - <string key="superclassName">NSButtonCell</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/ImageButtonCell.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">MenuButton</string> - <string key="superclassName">ToolbarButton</string> - <object class="NSMutableDictionary" key="outlets"> - <string key="NS.key.0">attachedMenu</string> - <string key="NS.object.0">NSMenu</string> - </object> - <object class="NSMutableDictionary" key="toOneOutletInfosByName"> - <string key="NS.key.0">attachedMenu</string> - <object class="IBToOneOutletInfo" key="NS.object.0"> - <string key="name">attachedMenu</string> - <string key="candidateClassName">NSMenu</string> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/MenuButton.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NewTabButton</string> - <string key="superclassName">NSButton</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/NewTabButton.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NewTabButtonCell</string> - <string key="superclassName">ImageButtonCell</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/NewTabButtonCell.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">ProfileMenuButton</string> - <string key="superclassName">MenuButton</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/ProfileMenuButton.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">TabStripView</string> - <string key="superclassName">NSView</string> - <object class="NSMutableDictionary" key="outlets"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>newTabButton</string> - <string>profileMenuButton</string> - </object> - <object class="NSArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>NewTabButton</string> - <string>ProfileMenuButton</string> - </object> - </object> - <object class="NSMutableDictionary" key="toOneOutletInfosByName"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>newTabButton</string> - <string>profileMenuButton</string> - </object> - <object class="NSArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBToOneOutletInfo"> - <string key="name">newTabButton</string> - <string key="candidateClassName">NewTabButton</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">profileMenuButton</string> - <string key="candidateClassName">ProfileMenuButton</string> - </object> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/TabStripView.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">TabWindowController</string> - <string key="superclassName">NSWindowController</string> - <object class="NSMutableDictionary" key="outlets"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>sideTabStripView_</string> - <string>tabContentArea_</string> - <string>tabStripView_</string> - </object> - <object class="NSArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>TabStripView</string> - <string>FastResizeView</string> - <string>TabStripView</string> - </object> - </object> - <object class="NSMutableDictionary" key="toOneOutletInfosByName"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>sideTabStripView_</string> - <string>tabContentArea_</string> - <string>tabStripView_</string> - </object> - <object class="NSArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBToOneOutletInfo"> - <string key="name">sideTabStripView_</string> - <string key="candidateClassName">TabStripView</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">tabContentArea_</string> - <string key="candidateClassName">FastResizeView</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">tabStripView_</string> - <string key="candidateClassName">TabStripView</string> - </object> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/TabWindowController.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">ToolbarButton</string> - <string key="superclassName">NSButton</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/ToolbarButton.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">UnderlayOpenGLHostingWindow</string> - <string key="superclassName">NSWindow</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/UnderlayOpenGLHostingWindow.h</string> - </object> - </object> - </object> - </object> - <int key="IBDocument.localizationMode">0</int> - <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> - <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> - <integer value="1050" key="NS.object.0"/> - </object> - <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> - <real value="1070" key="NS.object.0"/> - </object> - <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> - <integer value="3000" key="NS.object.0"/> - </object> - <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> - <int key="IBDocument.defaultPropertyAccessControl">3</int> - </data> -</archive> diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index 0d12c02..5636224 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -224,12 +224,8 @@ enum { // Private(TestingAPI) init routine with testing options. - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { - // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we - // can override it in a unit test. - NSString* nibpath = [base::mac::FrameworkBundle() - pathForResource:@"BrowserWindow" - ofType:@"nib"]; - if ((self = [super initWithWindowNibPath:nibpath owner:self])) { + bool hasTabStrip = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); + if ((self = [super initTabWindowControllerWithTabStrip:hasTabStrip])) { DCHECK(browser); initializing_ = YES; browser_.reset(browser); @@ -237,6 +233,12 @@ enum { NSWindow* window = [self window]; windowShim_.reset(new BrowserWindowCocoa(browser, self)); + // Set different minimum sizes on tabbed windows vs non-tabbed, e.g. popups. + // This has to happen before -enforceMinWindowSize: is called further down. + NSSize minSize = [self isTabbedWindow] ? + NSMakeSize(400, 272) : NSMakeSize(100, 122); + [[self window] setMinSize:minSize]; + // Create the bar visibility lock set; 10 is arbitrary, but should hopefully // be big enough to hold all locks that'll ever be needed. barVisibilityLocks_.reset([[NSMutableSet setWithCapacity:10] retain]); @@ -319,11 +321,11 @@ enum { // registering for the appropriate command state changes from the back-end. // Adds the toolbar to the content area. toolbarController_.reset([[ToolbarController alloc] - initWithModel:browser->toolbar_model() - commands:browser->command_controller()->command_updater() - profile:browser->profile() - browser:browser - resizeDelegate:self]); + initWithModel:browser->toolbar_model() + commands:browser->command_controller()->command_updater() + profile:browser->profile() + browser:browser + resizeDelegate:self]); [toolbarController_ setHasToolbar:[self hasToolbar] hasLocationBar:[self hasLocationBar]]; [[[self window] contentView] addSubview:[toolbarController_ view]]; @@ -429,13 +431,6 @@ enum { return self; } -- (void)awakeFromNib { - // Set different minimum sizes on tabbed windows vs non-tabbed, e.g. popups. - NSSize minSize = [self isTabbedWindow] ? - NSMakeSize(400, 272) : NSMakeSize(100, 122); - [[self window] setMinSize:minSize]; -} - - (void)dealloc { browser_->tab_strip_model()->CloseAllTabs(); [downloadShelfController_ exiting]; diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm index 2f89af4..7d31c4e 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm @@ -64,14 +64,11 @@ const CGFloat kLocBarBottomInset = 1; @implementation BrowserWindowController(Private) -// Create the appropriate tab strip controller based on whether or not side -// tabs are enabled. +// Create the tab strip controller. - (void)createTabStripController { - Class factory = [TabStripController class]; - DCHECK([previewableContentsController_ activeContainer]); DCHECK([[previewableContentsController_ activeContainer] window]); - tabStripController_.reset([[factory alloc] + tabStripController_.reset([[TabStripController alloc] initWithView:[self tabStripView] switchView:[previewableContentsController_ activeContainer] browser:browser_.get() diff --git a/chrome/browser/ui/cocoa/framed_browser_window.h b/chrome/browser/ui/cocoa/framed_browser_window.h index 255a8b8..ee70280 100644 --- a/chrome/browser/ui/cocoa/framed_browser_window.h +++ b/chrome/browser/ui/cocoa/framed_browser_window.h @@ -35,6 +35,10 @@ const NSInteger kFramedWindowButtonsWithoutTabStripOffsetFromLeft = 8; CGFloat windowButtonsInterButtonSpacing_; } +// Designated initializer. +- (id)initWithContentRect:(NSRect)contentRect + hasTabStrip:(BOOL)hasTabStrip; + // Tells the window to suppress title drawing. - (void)setShouldHideTitle:(BOOL)flag; diff --git a/chrome/browser/ui/cocoa/framed_browser_window.mm b/chrome/browser/ui/cocoa/framed_browser_window.mm index 4c8a502..a6cf628 100644 --- a/chrome/browser/ui/cocoa/framed_browser_window.mm +++ b/chrome/browser/ui/cocoa/framed_browser_window.mm @@ -75,29 +75,34 @@ const CGFloat kWindowGradientHeight = 24.0; @implementation FramedBrowserWindow - (id)initWithContentRect:(NSRect)contentRect - styleMask:(NSUInteger)aStyle - backing:(NSBackingStoreType)bufferingType - defer:(BOOL)flag { + hasTabStrip:(BOOL)hasTabStrip{ + NSUInteger styleMask = NSTitledWindowMask | + NSClosableWindowMask | + NSMiniaturizableWindowMask | + NSResizableWindowMask | + NSTexturedBackgroundWindowMask; if ((self = [super initWithContentRect:contentRect - styleMask:aStyle - backing:bufferingType - defer:flag])) { - if (aStyle & NSTexturedBackgroundWindowMask) { - // The following two calls fix http://crbug.com/25684 by preventing the - // window from recalculating the border thickness as the window is - // resized. - // This was causing the window tint to change for the default system theme - // when the window was being resized. - [self setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge]; - [self setContentBorderThickness:kWindowGradientHeight forEdge:NSMaxYEdge]; - } - + styleMask:styleMask + backing:NSBackingStoreBuffered + defer:YES])) { + // The following two calls fix http://crbug.com/25684 by preventing the + // window from recalculating the border thickness as the window is + // resized. + // This was causing the window tint to change for the default system theme + // when the window was being resized. + [self setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge]; + [self setContentBorderThickness:kWindowGradientHeight forEdge:NSMaxYEdge]; + + hasTabStrip_ = hasTabStrip; closeButton_ = [self standardWindowButton:NSWindowCloseButton]; [closeButton_ setPostsFrameChangedNotifications:YES]; + [self adjustButton:closeButton_ ofKind:NSWindowCloseButton]; miniaturizeButton_ = [self standardWindowButton:NSWindowMiniaturizeButton]; [miniaturizeButton_ setPostsFrameChangedNotifications:YES]; + [self adjustButton:miniaturizeButton_ ofKind:NSWindowMiniaturizeButton]; zoomButton_ = [self standardWindowButton:NSWindowZoomButton]; [zoomButton_ setPostsFrameChangedNotifications:YES]; + [self adjustButton:zoomButton_ ofKind:NSWindowZoomButton]; windowButtonsInterButtonSpacing_ = NSMinX([miniaturizeButton_ frame]) - NSMaxX([closeButton_ frame]); @@ -129,32 +134,6 @@ const CGFloat kWindowGradientHeight = 24.0; [super dealloc]; } -- (void)setWindowController:(NSWindowController*)controller { - if (controller == [self windowController]) { - return; - } - - [super setWindowController:controller]; - - BrowserWindowController* browserController - = static_cast<BrowserWindowController*>(controller); - if ([browserController isKindOfClass:[BrowserWindowController class]]) { - hasTabStrip_ = [browserController hasTabStrip]; - } else { - hasTabStrip_ = NO; - } - - // Force re-layout of the window buttons by wiggling the size of the frame - // view. - NSView* frameView = [[self contentView] superview]; - BOOL frameViewDidAutoresizeSubviews = [frameView autoresizesSubviews]; - [frameView setAutoresizesSubviews:NO]; - NSRect oldFrame = [frameView frame]; - [frameView setFrame:NSZeroRect]; - [frameView setFrame:oldFrame]; - [frameView setAutoresizesSubviews:frameViewDidAutoresizeSubviews]; -} - - (void)adjustCloseButton:(NSNotification*)notification { [self adjustButton:[notification object] ofKind:NSWindowCloseButton]; diff --git a/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm b/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm index 2d50d66..ec43f55 100644 --- a/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm +++ b/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm @@ -20,13 +20,9 @@ class FramedBrowserWindowTest : public CocoaTest { virtual void SetUp() { CocoaTest::SetUp(); // Create a window. - const NSUInteger mask = NSTitledWindowMask | NSClosableWindowMask | - NSMiniaturizableWindowMask | NSResizableWindowMask; window_ = [[FramedBrowserWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) - styleMask:mask - backing:NSBackingStoreBuffered - defer:NO]; + hasTabStrip:YES]; if (base::debug::BeingDebugged()) { [window_ orderFront:nil]; } else { @@ -105,6 +101,10 @@ TEST_F(FramedBrowserWindowTest, WindowWidgetLocation) { BOOL no = NO; // First without a tabstrip. + [window_ close]; + window_ = [[FramedBrowserWindow alloc] + initWithContentRect:NSMakeRect(0, 0, 800, 600) + hasTabStrip:NO]; id controller = [OCMockObject mockForClass:[BrowserWindowController class]]; [[[controller stub] andReturnValue:OCMOCK_VALUE(yes)] isKindOfClass:[BrowserWindowController class]]; @@ -134,8 +134,13 @@ TEST_F(FramedBrowserWindowTest, WindowWidgetLocation) { kFramedWindowButtonsWithoutTabStripOffsetFromTop); EXPECT_EQ(NSMinX(miniaturizeFrame), NSMaxX(closeBoxFrame) + [window_ windowButtonsInterButtonSpacing]); + [window_ setWindowController:nil]; // Then with a tabstrip. + [window_ close]; + window_ = [[FramedBrowserWindow alloc] + initWithContentRect:NSMakeRect(0, 0, 800, 600) + hasTabStrip:YES]; controller = [OCMockObject mockForClass:[BrowserWindowController class]]; [[[controller stub] andReturnValue:OCMOCK_VALUE(yes)] isKindOfClass:[BrowserWindowController class]]; diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_view.h b/chrome/browser/ui/cocoa/tabs/tab_strip_view.h index edcc79f..1cb4ba2 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_view.h +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_view.h @@ -25,8 +25,7 @@ // Handles being a drag-and-drop target. scoped_nsobject<URLDropTargetHandler> dropHandler_; - // Weak; the following come from the nib. - NewTabButton* newTabButton_; + scoped_nsobject<NewTabButton> newTabButton_; // Whether the drop-indicator arrow is shown, and if it is, the coordinate of // its tip. diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm index 8f25235..f935e7c 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm @@ -9,10 +9,13 @@ #include "base/logging.h" #include "base/mac/mac_util.h" #include "chrome/browser/themes/theme_service.h" -#import "chrome/browser/ui/cocoa/nsview_additions.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" +#import "chrome/browser/ui/cocoa/new_tab_button.h" +#import "chrome/browser/ui/cocoa/nsview_additions.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" #import "chrome/browser/ui/cocoa/view_id_util.h" +#include "grit/generated_resources.h" +#include "ui/base/l10n/l10n_util_mac.h" @implementation TabStripView @@ -22,6 +25,10 @@ - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { + newTabButton_.reset([[NewTabButton alloc] initWithFrame: + NSMakeRect(295, 0, 40, 27)]); + [newTabButton_ setToolTip:l10n_util::GetNSString(IDS_TOOLTIP_NEW_TAB)]; + // Set lastMouseUp_ = -1000.0 so that timestamp-lastMouseUp_ is big unless // lastMouseUp_ has been reset. lastMouseUp_ = -1000.0; @@ -242,7 +249,7 @@ } - (void)setNewTabButton:(NewTabButton*)button { - newTabButton_ = button; + newTabButton_.reset([button retain]); } - (void)setController:(TabStripController*)controller { diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.h b/chrome/browser/ui/cocoa/tabs/tab_window_controller.h index 24b5acc..6c353ca 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.h +++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.h @@ -11,12 +11,6 @@ // know anything about the actual tab implementation or model, as that is fairly // application-specific. It only provides an API to be overridden by subclasses // to fill in the details. -// -// This assumes that there will be a view in the nib, connected to -// |tabContentArea_|, that indicates the content that it switched when switching -// between tabs. It needs to be a regular NSView, not something like an NSBox -// because the TabStripController makes certain assumptions about how it can -// swap out subviews. #import <Cocoa/Cocoa.h> @@ -29,22 +23,21 @@ @interface TabWindowController : NSWindowController<NSWindowDelegate> { @private - IBOutlet FastResizeView* tabContentArea_; - IBOutlet TabStripView* tabStripView_; + scoped_nsobject<FastResizeView> tabContentArea_; + scoped_nsobject<TabStripView> tabStripView_; NSWindow* overlayWindow_; // Used during dragging for window opacity tricks NSView* cachedContentView_; // Used during dragging for identifying which // view is the proper content area in the overlay // (weak) scoped_nsobject<FocusTracker> focusBeforeOverlay_; BOOL closeDeferred_; // If YES, call performClose: in removeOverlay:. - // Difference between height of window content area and height of the - // |tabContentArea_|. Calculated when the window is loaded from the nib and - // cached in order to restore the delta when switching tab modes. - CGFloat contentAreaHeightDelta_; } @property(readonly, nonatomic) TabStripView* tabStripView; @property(readonly, nonatomic) FastResizeView* tabContentArea; +// This is the designated initializer for this class. +- (id)initTabWindowControllerWithTabStrip:(BOOL)hasTabStrip; + // Used during tab dragging to turn on/off the overlay window when a tab // is torn off. If -deferPerformClose (below) is used, -removeOverlay will // cause the controller to be autoreleased before returning. diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm index 6665b6c..5fa4b32 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm @@ -5,6 +5,8 @@ #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" #include "base/logging.h" +#import "chrome/browser/ui/cocoa/fast_resize_view.h" +#import "chrome/browser/ui/cocoa/framed_browser_window.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" #import "chrome/browser/ui/cocoa/themed_window.h" #import "ui/base/cocoa/focus_tracker.h" @@ -40,44 +42,51 @@ @end @implementation TabWindowController -@synthesize tabContentArea = tabContentArea_; + +- (id)initTabWindowControllerWithTabStrip:(BOOL)hasTabStrip { + NSRect contentRect = NSMakeRect(60, 229, 750, 600); + scoped_nsobject<FramedBrowserWindow> window( + [[FramedBrowserWindow alloc] initWithContentRect:contentRect + hasTabStrip:hasTabStrip]); + [window setReleasedWhenClosed:YES]; + + if ((self = [super initWithWindow:window])) { + [[self window] setDelegate:self]; + + tabContentArea_.reset([[FastResizeView alloc] initWithFrame: + NSMakeRect(0, 0, 750, 600)]); + [tabContentArea_ setAutoresizingMask:NSViewWidthSizable | + NSViewHeightSizable]; + [[[self window] contentView] addSubview:tabContentArea_]; + + tabStripView_.reset([[TabStripView alloc] initWithFrame: + NSMakeRect(0, 0, 750, 37)]); + [tabStripView_ setAutoresizingMask:NSViewWidthSizable | + NSViewMinYMargin]; + if (hasTabStrip) + [self addTabStripToWindow]; + } + return self; +} + +- (TabStripView*)tabStripView { + return tabStripView_; +} + +- (FastResizeView*)tabContentArea { + return tabContentArea_; +} // Add the top tab strop to the window, above the content box and add it to the // view hierarchy as a sibling of the content view so it can overlap with the // window frame. - (void)addTabStripToWindow { - NSRect contentFrame = [tabContentArea_ frame]; - NSRect tabFrame = - NSMakeRect(0, NSMaxY(contentFrame), - NSWidth(contentFrame), - NSHeight([tabStripView_ frame])); - [tabStripView_ setFrame:tabFrame]; + // The frame doesn't matter. This class relies on subclasses to do tab strip + // layout. NSView* contentParent = [[[self window] contentView] superview]; [contentParent addSubview:tabStripView_]; } -- (void)windowDidLoad { - // Cache the difference in height between the window content area and the - // tab content area. - NSRect tabFrame = [tabContentArea_ frame]; - NSRect contentFrame = [[[self window] contentView] frame]; - contentAreaHeightDelta_ = NSHeight(contentFrame) - NSHeight(tabFrame); - - if ([self hasTabStrip]) { - [self addTabStripToWindow]; - } else { - // No top tabstrip so remove the tabContentArea offset. - tabFrame.size.height = contentFrame.size.height; - [tabContentArea_ setFrame:tabFrame]; - } -} - -// Return the appropriate tab strip based on whether or not side tabs are -// enabled. -- (TabStripView*)tabStripView { - return tabStripView_; -} - - (void)removeOverlay { [self setUseOverlay:NO]; if (closeDeferred_) { diff --git a/chrome/chrome_nibs.gypi b/chrome/chrome_nibs.gypi index 65da7bd..c010ef2 100644 --- a/chrome/chrome_nibs.gypi +++ b/chrome/chrome_nibs.gypi @@ -15,7 +15,6 @@ 'app/nibs/BookmarkBubble.xib', 'app/nibs/BookmarkEditor.xib', 'app/nibs/BookmarkNameFolder.xib', - 'app/nibs/BrowserWindow.xib', 'app/nibs/ChromeToMobileBubble.xib', 'app/nibs/CollectedCookies.xib', 'app/nibs/ContentBlockedCookies.xib', |