diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-20 16:48:29 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-20 16:48:29 +0000 |
commit | b3e3a7c25563c04221141be853d91af264c8c440 (patch) | |
tree | 3fad894326a1e5514fcff26710a0541253a49ebd /chrome | |
parent | 42179c2ecb844952a49c44c7598400b7f69270db (diff) | |
download | chromium_src-b3e3a7c25563c04221141be853d91af264c8c440.zip chromium_src-b3e3a7c25563c04221141be853d91af264c8c440.tar.gz chromium_src-b3e3a7c25563c04221141be853d91af264c8c440.tar.bz2 |
Roll our own grow box since the OS one wants to indent by 3px due to the textured window style.
Review URL: http://codereview.chromium.org/21544
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/nibs/English.lproj/BrowserWindow.xib | 10 | ||||
-rw-r--r-- | chrome/app/nibs/English.lproj/TabContents.xib | 141 | ||||
-rw-r--r-- | chrome/app/theme/grow_box.png | bin | 0 -> 237 bytes | |||
-rw-r--r-- | chrome/browser/browser_window_cocoa.mm | 9 | ||||
-rw-r--r-- | chrome/browser/browser_window_controller.h | 3 | ||||
-rw-r--r-- | chrome/browser/browser_window_controller.mm | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/grow_box_view.h | 22 | ||||
-rw-r--r-- | chrome/browser/cocoa/grow_box_view.m | 34 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_contents_controller.h | 5 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_contents_controller.mm | 15 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.h | 3 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 5 | ||||
-rw-r--r-- | chrome/chrome.xcodeproj/project.pbxproj | 10 |
13 files changed, 182 insertions, 79 deletions
diff --git a/chrome/app/nibs/English.lproj/BrowserWindow.xib b/chrome/app/nibs/English.lproj/BrowserWindow.xib index c295123..9dd9841 100644 --- a/chrome/app/nibs/English.lproj/BrowserWindow.xib +++ b/chrome/app/nibs/English.lproj/BrowserWindow.xib @@ -8,7 +8,6 @@ <string key="IBDocument.HIToolboxVersion">353.00</string> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="56"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -35,7 +34,7 @@ <string key="NSClassName">NSApplication</string> </object> <object class="NSWindowTemplate" id="1005"> - <int key="NSWindowStyleMask">4367</int> + <int key="NSWindowStyleMask">4359</int> <int key="NSWindowBacking">2</int> <string key="NSWindowRect">{{60, 229}, {720, 578}}</string> <int key="NSWTFlags">536870912</int> @@ -99,10 +98,9 @@ <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> </object> <object class="NSCustomView" id="1029219716"> - <reference key="NSNextResponder"/> + <nil key="NSNextResponder"/> <int key="NSvFlags">266</int> <string key="NSFrameSize">{483, 25}</string> - <reference key="NSSuperview"/> <string key="NSClassName">TabStripView</string> </object> </object> @@ -233,9 +231,9 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{403, 402}, {720, 578}}</string> + <string>{{136, 278}, {720, 578}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{403, 402}, {720, 578}}</string> + <string>{{136, 278}, {720, 578}}</string> <boolean value="NO"/> <string>{196, 240}</string> <string>{{357, 418}, {480, 270}}</string> diff --git a/chrome/app/nibs/English.lproj/TabContents.xib b/chrome/app/nibs/English.lproj/TabContents.xib index 53e1ef9..0f493fa 100644 --- a/chrome/app/nibs/English.lproj/TabContents.xib +++ b/chrome/app/nibs/English.lproj/TabContents.xib @@ -8,7 +8,6 @@ <string key="IBDocument.HIToolboxVersion">353.00</string> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="94"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -55,6 +54,53 @@ <int key="NSvFlags">274</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSBox" id="753762894"> + <reference key="NSNextResponder" ref="675542922"/> + <int key="NSvFlags">18</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSView" id="250835567"> + <reference key="NSNextResponder" ref="753762894"/> + <int key="NSvFlags">256</int> + <string key="NSFrameSize">{480, 322}</string> + <reference key="NSSuperview" ref="753762894"/> + <reference key="NSWindow"/> + </object> + </object> + <string key="NSFrameSize">{480, 322}</string> + <reference key="NSSuperview" ref="675542922"/> + <reference key="NSWindow"/> + <string key="NSOffsets">{0, 0}</string> + <object class="NSTextFieldCell" key="NSTitleCell"> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">0</int> + <string key="NSContents">Box</string> + <object class="NSFont" key="NSSupport"> + <string key="NSName">LucidaGrande</string> + <double key="NSSize">1.100000e+01</double> + <int key="NSfFlags">3100</int> + </object> + <object class="NSColor" key="NSBackgroundColor" id="619004855"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">textBackgroundColor</string> + <object class="NSColor" key="NSColor" id="524635398"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MQA</bytes> + </object> + </object> + <object class="NSColor" key="NSTextColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes> + </object> + </object> + <reference key="NSContentView" ref="250835567"/> + <int key="NSBorderType">0</int> + <int key="NSBoxType">4</int> + <int key="NSTitlePosition">0</int> + <bool key="NSTransparent">NO</bool> + <reference key="NSFillColor2" ref="524635398"/> + </object> <object class="NSCustomView" id="588745489"> <reference key="NSNextResponder" ref="675542922"/> <int key="NSvFlags">266</int> @@ -65,6 +111,7 @@ <int key="NSvFlags">265</int> <string key="NSFrame">{{411, 5}, {24, 27}}</string> <reference key="NSSuperview" ref="588745489"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="145095454"> <int key="NSCellFlags">67239424</int> @@ -97,6 +144,7 @@ <int key="NSvFlags">266</int> <string key="NSFrame">{{131, 5}, {308, 27}}</string> <reference key="NSSuperview" ref="588745489"/> + <reference key="NSWindow"/> <int key="NSTag">33004</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="971876011"> @@ -139,15 +187,7 @@ <reference key="NSSupport" ref="632923964"/> <reference key="NSControlView" ref="146626462"/> <bool key="NSDrawsBackground">YES</bool> - <object class="NSColor" key="NSBackgroundColor" id="619004855"> - <int key="NSColorSpace">6</int> - <string key="NSCatalogName">System</string> - <string key="NSColorName">textBackgroundColor</string> - <object class="NSColor" key="NSColor" id="524635398"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MQA</bytes> - </object> - </object> + <reference key="NSBackgroundColor" ref="619004855"/> <reference key="NSTextColor" ref="821614029"/> </object> </object> @@ -156,6 +196,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{102, 4}, {29, 29}}</string> <reference key="NSSuperview" ref="588745489"/> + <reference key="NSWindow"/> <int key="NSTag">35000</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="279099892"> @@ -182,6 +223,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{67, 4}, {31, 29}}</string> <reference key="NSSuperview" ref="588745489"/> + <reference key="NSWindow"/> <int key="NSTag">33002</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="352237189"> @@ -207,6 +249,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{34, 4}, {28, 29}}</string> <reference key="NSSuperview" ref="588745489"/> + <reference key="NSWindow"/> <int key="NSTag">33001</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="616960232"> @@ -233,6 +276,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{6, 4}, {29, 29}}</string> <reference key="NSSuperview" ref="588745489"/> + <reference key="NSWindow"/> <int key="NSTag">33000</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="599914932"> @@ -259,6 +303,7 @@ <int key="NSvFlags">265</int> <string key="NSFrame">{{439, 4}, {29, 29}}</string> <reference key="NSSuperview" ref="588745489"/> + <reference key="NSWindow"/> <int key="NSTag">33005</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="932073098"> @@ -283,48 +328,21 @@ </object> <string key="NSFrame">{{0, 322}, {480, 38}}</string> <reference key="NSSuperview" ref="675542922"/> + <reference key="NSWindow"/> <string key="NSClassName">ToolbarView</string> </object> - <object class="NSBox" id="753762894"> + <object class="NSCustomView" id="995989345"> <reference key="NSNextResponder" ref="675542922"/> - <int key="NSvFlags">18</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSView" id="250835567"> - <reference key="NSNextResponder" ref="753762894"/> - <int key="NSvFlags">256</int> - <string key="NSFrameSize">{480, 322}</string> - <reference key="NSSuperview" ref="753762894"/> - </object> - </object> - <string key="NSFrameSize">{480, 322}</string> + <int key="NSvFlags">289</int> + <string key="NSFrame">{{465, 0}, {15, 15}}</string> <reference key="NSSuperview" ref="675542922"/> - <string key="NSOffsets">{0, 0}</string> - <object class="NSTextFieldCell" key="NSTitleCell"> - <int key="NSCellFlags">67239424</int> - <int key="NSCellFlags2">0</int> - <string key="NSContents">Box</string> - <object class="NSFont" key="NSSupport"> - <string key="NSName">LucidaGrande</string> - <double key="NSSize">1.100000e+01</double> - <int key="NSfFlags">3100</int> - </object> - <reference key="NSBackgroundColor" ref="619004855"/> - <object class="NSColor" key="NSTextColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes> - </object> - </object> - <reference key="NSContentView" ref="250835567"/> - <int key="NSBorderType">0</int> - <int key="NSBoxType">4</int> - <int key="NSTitlePosition">0</int> - <bool key="NSTransparent">NO</bool> - <reference key="NSFillColor2" ref="524635398"/> + <reference key="NSWindow"/> + <string key="NSClassName">GrowBoxView</string> </object> </object> <string key="NSFrameSize">{480, 360}</string> <reference key="NSSuperview"/> + <reference key="NSWindow"/> </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> <string key="NSMinSize">{480, 382}</string> @@ -446,6 +464,14 @@ </object> <int key="connectionID">169</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">growBox_</string> + <reference key="source" ref="326691890"/> + <reference key="destination" ref="995989345"/> + </object> + <int key="connectionID">176</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -487,6 +513,7 @@ <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="588745489"/> <reference ref="753762894"/> + <reference ref="995989345"/> </object> <reference key="parent" ref="886393115"/> </object> @@ -612,6 +639,14 @@ <object class="IBObjectRecord"> <int key="objectID">164</int> <reference key="object" ref="753762894"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + <reference key="parent" ref="675542922"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">175</int> + <reference key="object" ref="995989345"/> <reference key="parent" ref="675542922"/> </object> </object> @@ -644,6 +679,7 @@ <string>137.IBPluginDependency</string> <string>138.IBPluginDependency</string> <string>164.IBPluginDependency</string> + <string>175.IBPluginDependency</string> <string>93.IBEditorWindowLastContentRect</string> <string>93.IBViewEditorWindowController.showingLayoutRectangles</string> <string>93.IBWindowTemplateEditedContentRect</string> @@ -679,9 +715,10 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{523, 153}, {480, 360}}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>{{273, 241}, {480, 360}}</string> <boolean value="YES" id="5"/> - <string>{{523, 153}, {480, 360}}</string> + <string>{{273, 241}, {480, 360}}</string> <reference ref="5"/> <reference ref="5"/> <string>{480, 360}</string> @@ -709,7 +746,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">169</int> + <int key="maxID">176</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -727,6 +764,14 @@ </object> </object> <object class="IBPartialClassDescription"> + <string key="className">GrowBoxView</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/grow_box_view.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> <string key="className">TabContentsController</string> <string key="superclassName">NSViewController</string> <object class="NSMutableDictionary" key="actions"> @@ -740,6 +785,7 @@ <string>backButton_</string> <string>contentsBox_</string> <string>forwardButton_</string> + <string>growBox_</string> <string>locationBar_</string> <string>reloadStopButton_</string> <string>starButton_</string> @@ -749,6 +795,7 @@ <string>NSButton</string> <string>NSBox</string> <string>NSButton</string> + <string>GrowBoxView</string> <string>NSTextField</string> <string>NSButton</string> <string>NSButton</string> diff --git a/chrome/app/theme/grow_box.png b/chrome/app/theme/grow_box.png Binary files differnew file mode 100644 index 0000000..8278fec --- /dev/null +++ b/chrome/app/theme/grow_box.png diff --git a/chrome/browser/browser_window_cocoa.mm b/chrome/browser/browser_window_cocoa.mm index e61bea443..10d56db 100644 --- a/chrome/browser/browser_window_cocoa.mm +++ b/chrome/browser/browser_window_cocoa.mm @@ -99,15 +99,8 @@ bool BrowserWindowCocoa::IsFullscreen() const { return false; } -@interface NSWindow(OSInternals) -- (NSRect)_growBoxRect; -@end - gfx::Rect BrowserWindowCocoa::GetRootWindowResizerRect() const { - NSRect windowRect = [window_ _growBoxRect]; - // convert from window coordinates to the coordinates of the currently - // selected tab. |tabRect| will already be flipped into WebKit coordinates. - NSRect tabRect = [controller_ selectedTabGrowBoxFromWindowGrowBox:windowRect]; + NSRect tabRect = [controller_ selectedTabGrowBoxRect]; return gfx::Rect(NSRectToCGRect(tabRect)); } diff --git a/chrome/browser/browser_window_controller.h b/chrome/browser/browser_window_controller.h index 9428cd3..db91e5a 100644 --- a/chrome/browser/browser_window_controller.h +++ b/chrome/browser/browser_window_controller.h @@ -57,8 +57,7 @@ class BrowserWindow; // Return the rect, in WebKit coordinates (flipped), of the window's grow box // in the coordinate system of the content area of the currently selected tab. -// |windowGrowBox| needs to be in the window's coordinate system. -- (NSRect)selectedTabGrowBoxFromWindowGrowBox:(NSRect)windowGrowBox; +- (NSRect)selectedTabGrowBoxRect; @end diff --git a/chrome/browser/browser_window_controller.mm b/chrome/browser/browser_window_controller.mm index eade6e2..63e0b91 100644 --- a/chrome/browser/browser_window_controller.mm +++ b/chrome/browser/browser_window_controller.mm @@ -148,9 +148,9 @@ // Return the rect, in WebKit coordinates (flipped), of the window's grow box // in the coordinate system of the content area of the currently selected tab. // |windowGrowBox| needs to be in the window's coordinate system. -- (NSRect)selectedTabGrowBoxFromWindowGrowBox:(NSRect)windowGrowBox { +- (NSRect)selectedTabGrowBoxRect { return [tabStripController_ - selectedTabGrowBoxFromWindowGrowBox:windowGrowBox]; + selectedTabGrowBoxRect]; } @end diff --git a/chrome/browser/cocoa/grow_box_view.h b/chrome/browser/cocoa/grow_box_view.h new file mode 100644 index 0000000..60c51f0 --- /dev/null +++ b/chrome/browser/cocoa/grow_box_view.h @@ -0,0 +1,22 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_COCOA_GROW_BOX_VIEW_H_ +#define CHROME_BROWSER_COCOA_GROW_BOX_VIEW_H_ + +#import <Cocoa/Cocoa.h> + +// A class that handles drawing and mouse tracking to replace the standard +// window "grow box" grippy in cases where the OS one won't do. Relies on +// an image named "grow_box" be included in the application's resources. The +// box should be 15x15 in size, but that's not a requirement. + +@interface GrowBoxView : NSView { + @private + NSImage* image_; // grow box image +} + +@end + +#endif // CHROME_BROWSER_COCOA_GROW_BOX_VIEW_H_ diff --git a/chrome/browser/cocoa/grow_box_view.m b/chrome/browser/cocoa/grow_box_view.m new file mode 100644 index 0000000..79f3ca0 --- /dev/null +++ b/chrome/browser/cocoa/grow_box_view.m @@ -0,0 +1,34 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "chrome/browser/cocoa/grow_box_view.h" + +@implementation GrowBoxView + +- (void)awakeFromNib { + image_ = [[NSImage imageNamed:@"grow_box"] retain]; +} + +- (void)dealloc { + [image_ release]; + [super dealloc]; +} + +// Draws the "grow_box" image in our bounds. +- (void)drawRect:(NSRect)dirtyRect { + [image_ drawInRect:[self bounds] fromRect:NSZeroRect + operation:NSCompositeSourceOver fraction:1.0]; +} + +// Called when the user clicks and drags within the bounds. Resize the window's +// frame based on the delta of the drag. +- (void)mouseDragged:(NSEvent*)event { + NSRect frame = [[self window] frame]; + frame.size.width += [event deltaX]; + frame.origin.y -= [event deltaY]; + frame.size.height += [event deltaY]; + [[self window] setFrame:frame display:YES]; +} + +@end diff --git a/chrome/browser/cocoa/tab_contents_controller.h b/chrome/browser/cocoa/tab_contents_controller.h index 20d9a38..9f2eddd 100644 --- a/chrome/browser/cocoa/tab_contents_controller.h +++ b/chrome/browser/cocoa/tab_contents_controller.h @@ -8,6 +8,7 @@ #include <Cocoa/Cocoa.h> class CommandUpdater; +@class GrowBoxView; class LocationBar; class TabContents; class TabContentsCommandObserver; @@ -36,6 +37,7 @@ class TabStripModel; IBOutlet NSButton* starButton_; IBOutlet NSTextField* locationBar_; IBOutlet NSBox* contentsBox_; + IBOutlet GrowBoxView* growBox_; } // Create the contents of a tab represented by |contents| and loaded from the @@ -70,8 +72,7 @@ class TabStripModel; // Return the rect, in WebKit coordinates (flipped), of the window's grow box // in the coordinate system of the content area of this tab. -// |windowGrowBox| needs to be in the window's coordinate system. -- (NSRect)growBoxFromWindowGrowBox:(NSRect)windowGrowBox; +- (NSRect)growBoxRect; @end diff --git a/chrome/browser/cocoa/tab_contents_controller.mm b/chrome/browser/cocoa/tab_contents_controller.mm index 5d62716..8924a87 100644 --- a/chrome/browser/cocoa/tab_contents_controller.mm +++ b/chrome/browser/cocoa/tab_contents_controller.mm @@ -204,18 +204,21 @@ class LocationBarBridge : public LocationBar { // Return the rect, in WebKit coordinates (flipped), of the window's grow box // in the coordinate system of the content area of this tab. -// |windowGrowBox| needs to be in the window's coordinate system. -- (NSRect)growBoxFromWindowGrowBox:(NSRect)windowGrowBox { +- (NSRect)growBoxRect { NSRect localGrowBox = NSMakeRect(0, 0, 0, 0); NSView* contentView = contents_->GetNativeView(); if (contentView) { - localGrowBox = windowGrowBox; + // For the rect, we start with the grow box view which is a sibling of + // the content view's containing box. It's in the coordinate system of + // the controller view. + localGrowBox = [growBox_ frame]; // The scrollbar assumes that the resizer goes all the way down to the // bottom corner, so we ignore any y offset to the rect itself and use the // entire bottom corner. localGrowBox.origin.y = 0; - // Convert to view coordinates from window coordinates. - localGrowBox = [contentView convertRect:localGrowBox fromView:nil]; + // Convert to the content view's coordinates. + localGrowBox = [contentView convertRect:localGrowBox + fromView:[self view]]; // Flip the rect in view coordinates localGrowBox.origin.y = [contentView frame].size.height - localGrowBox.origin.y - @@ -264,5 +267,3 @@ std::wstring LocationBarBridge::GetInputString() const { void LocationBarBridge::FocusLocation() { [controller_ focusLocationBar]; } - - diff --git a/chrome/browser/cocoa/tab_strip_controller.h b/chrome/browser/cocoa/tab_strip_controller.h index 6062d70..5a03525 100644 --- a/chrome/browser/cocoa/tab_strip_controller.h +++ b/chrome/browser/cocoa/tab_strip_controller.h @@ -59,8 +59,7 @@ class TabContents; // Return the rect, in WebKit coordinates (flipped), of the window's grow box // in the coordinate system of the content area of the currently selected tab. -// |windowGrowBox| needs to be in the window's coordinate system. -- (NSRect)selectedTabGrowBoxFromWindowGrowBox:(NSRect)windowGrowBox; +- (NSRect)selectedTabGrowBoxRect; @end diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index 65ad9b0..2f821e5 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -336,8 +336,7 @@ class TabStripBridge : public TabStripModelObserver { // Return the rect, in WebKit coordinates (flipped), of the window's grow box // in the coordinate system of the content area of the currently selected tab. -// |windowGrowBox| needs to be in the window's coordinate system. -- (NSRect)selectedTabGrowBoxFromWindowGrowBox:(NSRect)windowGrowBox { +- (NSRect)selectedTabGrowBoxRect { TabContents* selectedContents = model_->GetSelectedTabContents(); if (!selectedContents) { // When the window is initially being constructed, there may be no currently @@ -349,7 +348,7 @@ class TabStripBridge : public TabStripModelObserver { } TabContentsController* selectedController = [self controllerWithContents:selectedContents]; - return [selectedController growBoxFromWindowGrowBox:windowGrowBox]; + return [selectedController growBoxRect]; } @end diff --git a/chrome/chrome.xcodeproj/project.pbxproj b/chrome/chrome.xcodeproj/project.pbxproj index 8a2a529..bc2fa00 100644 --- a/chrome/chrome.xcodeproj/project.pbxproj +++ b/chrome/chrome.xcodeproj/project.pbxproj @@ -545,6 +545,8 @@ E48FB97A0EC4EA4A0052B72B /* url_request_mock_net_error_job.cc in Sources */ = {isa = PBXBuildFile; fileRef = E48FB9720EC4EA270052B72B /* url_request_mock_net_error_job.cc */; }; E48FB97C0EC4EA540052B72B /* url_request_slow_download_job.cc in Sources */ = {isa = PBXBuildFile; fileRef = E48FB9740EC4EA270052B72B /* url_request_slow_download_job.cc */; }; E48FB9870EC4EBA10052B72B /* safe_browsing_database_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFAE40E9D49DE009A6919 /* safe_browsing_database_unittest.cc */; }; + E4A3EB130F4EFCF400596CC2 /* grow_box_view.m in Sources */ = {isa = PBXBuildFile; fileRef = E4A3EB120F4EFCF400596CC2 /* grow_box_view.m */; }; + E4A3EB390F4EFF4D00596CC2 /* grow_box.png in Resources */ = {isa = PBXBuildFile; fileRef = E4A3EB380F4EFF4D00596CC2 /* grow_box.png */; }; E4DCDB9D0F4091C00084059A /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4DCDB9C0F4091BF0084059A /* ApplicationServices.framework */; }; E4DCDC8F0F4091F30084059A /* libWebKitSystemInterfaceLeopard.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4DCDC8E0F4091F30084059A /* libWebKitSystemInterfaceLeopard.a */; }; E4DCDC900F40929C0084059A /* libglue.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 826850180F2FC82E009F6555 /* libglue.a */; }; @@ -2782,6 +2784,9 @@ E48FB9730EC4EA270052B72B /* url_request_mock_net_error_job.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = url_request_mock_net_error_job.h; sourceTree = "<group>"; }; E48FB9740EC4EA270052B72B /* url_request_slow_download_job.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = url_request_slow_download_job.cc; sourceTree = "<group>"; }; E48FB9750EC4EA270052B72B /* url_request_slow_download_job.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = url_request_slow_download_job.h; sourceTree = "<group>"; }; + E4A3EB110F4EFCF400596CC2 /* grow_box_view.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = grow_box_view.h; path = cocoa/grow_box_view.h; sourceTree = "<group>"; }; + E4A3EB120F4EFCF400596CC2 /* grow_box_view.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = grow_box_view.m; path = cocoa/grow_box_view.m; sourceTree = "<group>"; }; + E4A3EB380F4EFF4D00596CC2 /* grow_box.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = grow_box.png; path = theme/grow_box.png; sourceTree = "<group>"; }; E4DCDB9C0F4091BF0084059A /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; }; E4DCDC8E0F4091F30084059A /* libWebKitSystemInterfaceLeopard.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libWebKitSystemInterfaceLeopard.a; path = ../third_party/WebKit/WebKitLibraries/libWebKitSystemInterfaceLeopard.a; sourceTree = SOURCE_ROOT; }; E4F324400EE5CE94002533CE /* extension.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extension.cc; sourceTree = "<group>"; }; @@ -4402,6 +4407,7 @@ E46C50510F291C0E00B393B8 /* back.pdf */, E46C50530F291C1E00B393B8 /* forward.pdf */, E46C51230F2A14A300B393B8 /* go.pdf */, + E4A3EB380F4EFF4D00596CC2 /* grow_box.png */, E46C50570F291C3B00B393B8 /* newtab.pdf */, E46C50540F291C1E00B393B8 /* reload.pdf */, 824FC14E0F44C56A000299E5 /* sadtab.png */, @@ -4416,6 +4422,8 @@ children = ( 82BB33080F44B57C00761F43 /* base_view.h */, 82BB33090F44B57C00761F43 /* base_view.mm */, + E4A3EB110F4EFCF400596CC2 /* grow_box_view.h */, + E4A3EB120F4EFCF400596CC2 /* grow_box_view.m */, 824FC1550F44C59C000299E5 /* sad_tab_view.h */, 824FC1540F44C59C000299E5 /* sad_tab_view.mm */, A7CBAD370F322A7E00360BF5 /* shell_dialogs_mac.mm */, @@ -5192,6 +5200,7 @@ E43A79FA0F1D192000ABD5D1 /* eastWestResizeCursor.png in Resources */, E46C50550F291C1E00B393B8 /* forward.pdf in Resources */, E46C51240F2A14A300B393B8 /* go.pdf in Resources */, + E4A3EB390F4EFF4D00596CC2 /* grow_box.png in Resources */, E43A79FB0F1D192000ABD5D1 /* helpCursor.png in Resources */, E43A79FC0F1D192000ABD5D1 /* linkCursor.png in Resources */, 4DCE9E2D0EF0B8C000682526 /* MainMenu.xib in Resources */, @@ -5741,6 +5750,7 @@ E45060F20EE87D41003BE099 /* chrome_exe_main.mm in Sources */, 331B91820F3BCF1A008B1C46 /* debug_message_handler.cc in Sources */, 331B93920F3BF237008B1C46 /* external_js_object.cc in Sources */, + E4A3EB130F4EFCF400596CC2 /* grow_box_view.m in Sources */, 331B92820F3BE2B4008B1C46 /* renderer_glue.cc in Sources */, E42155D80F3240AF00A4A951 /* tab_strip_view.mm in Sources */, E46C519A0F2A20CC00B393B8 /* toolbar_button_cell.mm in Sources */, |