diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 02:13:45 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 02:13:45 +0000 |
commit | 943d8120c51e2ed0146d85a15298d7fa30f316e0 (patch) | |
tree | 74d94e42c0590d308074ad8262cbf36656b2e708 /chrome/browser/cocoa | |
parent | 8e0049d83d792dec1d2981d4f95369ca8a7b0558 (diff) | |
download | chromium_src-943d8120c51e2ed0146d85a15298d7fa30f316e0.zip chromium_src-943d8120c51e2ed0146d85a15298d7fa30f316e0.tar.gz chromium_src-943d8120c51e2ed0146d85a15298d7fa30f316e0.tar.bz2 |
Detach reload from omnibox, combine with stop, and eliminate go.
This does the basic surgery on all three OSes without trying to fix up the visual appearance. As a result, things look pretty ugly. My intent is to at least put endcaps on the omnibox in a subsequent patch.
BUG=45745,45762,45763
TEST=Reload and stop should be combined; go should be gone.
Review URL: http://codereview.chromium.org/2677003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/browser_window_cocoa.h | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_cocoa.mm | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/location_bar_view_mac.h | 1 | ||||
-rw-r--r-- | chrome/browser/cocoa/location_bar_view_mac.mm | 5 | ||||
-rw-r--r-- | chrome/browser/cocoa/side_tabs_toolbar_controller.h | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/side_tabs_toolbar_controller.mm | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/toolbar_controller.h | 1 | ||||
-rw-r--r-- | chrome/browser/cocoa/toolbar_controller.mm | 141 | ||||
-rw-r--r-- | chrome/browser/cocoa/toolbar_controller_unittest.mm | 20 |
9 files changed, 61 insertions, 119 deletions
diff --git a/chrome/browser/cocoa/browser_window_cocoa.h b/chrome/browser/cocoa/browser_window_cocoa.h index b6aa455..4d8f017 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.h +++ b/chrome/browser/cocoa/browser_window_cocoa.h @@ -53,7 +53,7 @@ class BrowserWindowCocoa : public BrowserWindow, virtual bool IsFullscreenBubbleVisible() const; virtual LocationBar* GetLocationBar() const; virtual void SetFocusToLocationBar(bool select_all); - virtual void UpdateStopGoState(bool is_loading, bool force); + virtual void UpdateReloadStopState(bool is_loading, bool force); virtual void UpdateToolbar(TabContents* contents, bool should_restore_state); virtual void FocusToolbar(); diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm index 78f2221..0b8111e 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/cocoa/browser_window_cocoa.mm @@ -206,7 +206,7 @@ void BrowserWindowCocoa::SetFocusToLocationBar(bool select_all) { [controller_ focusLocationBar:select_all ? YES : NO]; } -void BrowserWindowCocoa::UpdateStopGoState(bool is_loading, bool force) { +void BrowserWindowCocoa::UpdateReloadStopState(bool is_loading, bool force) { [controller_ setIsLoading:is_loading ? YES : NO]; } diff --git a/chrome/browser/cocoa/location_bar_view_mac.h b/chrome/browser/cocoa/location_bar_view_mac.h index 2d8d57e..74c0451 100644 --- a/chrome/browser/cocoa/location_bar_view_mac.h +++ b/chrome/browser/cocoa/location_bar_view_mac.h @@ -54,7 +54,6 @@ class LocationBarViewMac : public AutocompleteEditController, virtual WindowOpenDisposition GetWindowOpenDisposition() const; virtual PageTransition::Type GetPageTransition() const; virtual void AcceptInput(); - virtual void AcceptInputWithDisposition(WindowOpenDisposition disposition); virtual void FocusLocation(bool select_all); virtual void FocusSearch(); virtual void UpdateContentSettingsIcons(); diff --git a/chrome/browser/cocoa/location_bar_view_mac.mm b/chrome/browser/cocoa/location_bar_view_mac.mm index ea02141..9be750a 100644 --- a/chrome/browser/cocoa/location_bar_view_mac.mm +++ b/chrome/browser/cocoa/location_bar_view_mac.mm @@ -124,11 +124,6 @@ PageTransition::Type LocationBarViewMac::GetPageTransition() const { void LocationBarViewMac::AcceptInput() { WindowOpenDisposition disposition = event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); - AcceptInputWithDisposition(disposition); -} - -void LocationBarViewMac::AcceptInputWithDisposition( - WindowOpenDisposition disposition) { edit_view_->model()->AcceptInput(disposition, false); } diff --git a/chrome/browser/cocoa/side_tabs_toolbar_controller.h b/chrome/browser/cocoa/side_tabs_toolbar_controller.h index ce1ed7c..9516262 100644 --- a/chrome/browser/cocoa/side_tabs_toolbar_controller.h +++ b/chrome/browser/cocoa/side_tabs_toolbar_controller.h @@ -16,6 +16,10 @@ @interface SideTabsToolbarController : ToolbarController { @private + // TODO(shess): |goButton_| no longer exists in ToolbarController. + // It's not clear to me that |goButton_| is the right name for this + // class to use. + IBOutlet NSButton* goButton_; IBOutlet NSButton* starButton_; IBOutlet NSTextField* title_; IBOutlet NSProgressIndicator* loadingSpinner_; diff --git a/chrome/browser/cocoa/side_tabs_toolbar_controller.mm b/chrome/browser/cocoa/side_tabs_toolbar_controller.mm index 5e65111..989538d 100644 --- a/chrome/browser/cocoa/side_tabs_toolbar_controller.mm +++ b/chrome/browser/cocoa/side_tabs_toolbar_controller.mm @@ -35,6 +35,10 @@ NSString* const kSearchButtonImageName = @"omnibox_search.pdf"; - (void)awakeFromNib { [super awakeFromNib]; + // TODO(shess): |goButton_| is no longer in |ToolbarController|. + // AFAICT this code partially implements a new feature (see + // http://crbug.com/44773) which may be in conflict with + // http://crbug.com/45762 . [goButton_ setImage:nsimage_cache::ImageNamed(kSearchButtonImageName)]; [[locationBar_ autocompleteTextFieldCell] setStarIconView:nil]; } diff --git a/chrome/browser/cocoa/toolbar_controller.h b/chrome/browser/cocoa/toolbar_controller.h index 1c81543..86574b5 100644 --- a/chrome/browser/cocoa/toolbar_controller.h +++ b/chrome/browser/cocoa/toolbar_controller.h @@ -52,7 +52,6 @@ class ToolbarModel; IBOutlet DelayedMenuButton* forwardButton_; IBOutlet NSButton* reloadButton_; IBOutlet NSButton* homeButton_; - IBOutlet NSButton* goButton_; IBOutlet MenuButton* pageButton_; IBOutlet MenuButton* wrenchButton_; IBOutlet AutocompleteTextField* locationBar_; diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm index 9d90a0c..a8974de 100644 --- a/chrome/browser/cocoa/toolbar_controller.mm +++ b/chrome/browser/cocoa/toolbar_controller.mm @@ -48,17 +48,17 @@ namespace { // Names of images in the bundle for buttons. NSString* const kBackButtonImageName = @"back_Template.pdf"; NSString* const kForwardButtonImageName = @"forward_Template.pdf"; -NSString* const kReloadButtonImageName = @"reload_Template.pdf"; +NSString* const kReloadButtonReloadImageName = @"reload_Template.pdf"; +NSString* const kReloadButtonStopImageName = @"stop_Template.pdf"; NSString* const kHomeButtonImageName = @"home_Template.pdf"; -NSString* const kGoButtonGoImageName = @"go_Template.pdf"; -NSString* const kGoButtonStopImageName = @"stop_Template.pdf"; NSString* const kPageButtonImageName = @"menu_page_Template.pdf"; NSString* const kWrenchButtonImageName = @"menu_chrome_Template.pdf"; // Height of the toolbar in pixels when the bookmark bar is closed. const CGFloat kBaseToolbarHeight = 36.0; -// The distance from the 'Go' button to the Browser Actions container in pixels. +// The distance from the location bar to the Browser Actions container +// in pixels. const CGFloat kBrowserActionsContainerLeftPadding = 5.0; // The minimum width of the location bar in pixels. @@ -75,13 +75,13 @@ const CGFloat kAnimationDuration = 0.2; - (void)prefChanged:(std::wstring*)prefName; - (BackgroundGradientView*)backgroundGradientView; - (void)toolbarFrameChanged; -- (void)pinGoButtonToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate; +- (void)pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate; - (void)maintainMinimumLocationBarWidth; - (void)adjustBrowserActionsContainerForNewWindow:(NSNotification*)notification; - (void)browserActionsContainerDragged:(NSNotification*)notification; - (void)browserActionsContainerDragFinished:(NSNotification*)notification; - (void)browserActionsVisibilityChanged:(NSNotification*)notification; -- (void)adjustLocationAndGoPositionsBy:(CGFloat)dX animate:(BOOL)animate; +- (void)adjustLocationSizeBy:(CGFloat)dX animate:(BOOL)animate; @end namespace ToolbarControllerInternal { @@ -217,9 +217,9 @@ class PrefObserverBridge : public NotificationObserver { // the xib, we must set them in code. [backButton_ setImage:nsimage_cache::ImageNamed(kBackButtonImageName)]; [forwardButton_ setImage:nsimage_cache::ImageNamed(kForwardButtonImageName)]; - [reloadButton_ setImage:nsimage_cache::ImageNamed(kReloadButtonImageName)]; + [reloadButton_ + setImage:nsimage_cache::ImageNamed(kReloadButtonReloadImageName)]; [homeButton_ setImage:nsimage_cache::ImageNamed(kHomeButtonImageName)]; - [goButton_ setImage:nsimage_cache::ImageNamed(kGoButtonGoImageName)]; [pageButton_ setImage:nsimage_cache::ImageNamed(kPageButtonImageName)]; [wrenchButton_ setImage:nsimage_cache::ImageNamed(kWrenchButtonImageName)]; @@ -271,9 +271,9 @@ class PrefObserverBridge : public NotificationObserver { NSView* toolbarView = [self view]; [toolbarView addTrackingArea:trackingArea_.get()]; - // We want a dynamic tooltip on the go button, so tell the go button to ask - // us for the tooltip. - [goButton_ addToolTipRect:[goButton_ bounds] owner:self userData:nil]; + // We want a dynamic tooltip on the reload button, so tell the + // reload button to ask us for the tooltip. + [reloadButton_ addToolTipRect:[reloadButton_ bounds] owner:self userData:nil]; // If the user has any Browser Actions installed, the container view for them // may have to be resized depending on the width of the toolbar frame. @@ -307,10 +307,6 @@ class PrefObserverBridge : public NotificationObserver { [[locationBar_ cell] accessibilitySetOverrideValue:description forAttribute:NSAccessibilityDescriptionAttribute]; - description = l10n_util::GetNSStringWithFixup(IDS_ACCNAME_GO); - [[goButton_ cell] - accessibilitySetOverrideValue:description - forAttribute:NSAccessibilityDescriptionAttribute]; description = l10n_util::GetNSStringWithFixup(IDS_ACCNAME_PAGE); [[pageButton_ cell] accessibilitySetOverrideValue:description @@ -410,15 +406,15 @@ class PrefObserverBridge : public NotificationObserver { } - (void)setIsLoading:(BOOL)isLoading { - NSString* imageName = kGoButtonGoImageName; - NSInteger tag = IDC_GO; + NSString* imageName = kReloadButtonReloadImageName; + NSInteger tag = IDC_RELOAD; if (isLoading) { - imageName = kGoButtonStopImageName; + imageName = kReloadButtonStopImageName; tag = IDC_STOP; } NSImage* stopStartImage = nsimage_cache::ImageNamed(imageName); - [goButton_ setImage:stopStartImage]; - [goButton_ setTag:tag]; + [reloadButton_ setImage:stopStartImage]; + [reloadButton_ setTag:tag]; } - (void)setHasToolbar:(BOOL)toolbar hasLocationBar:(BOOL)locBar { @@ -472,8 +468,8 @@ class PrefObserverBridge : public NotificationObserver { // Returns an array of views in the order of the outlets above. - (NSArray*)toolbarViews { return [NSArray arrayWithObjects:backButton_, forwardButton_, reloadButton_, - homeButton_, goButton_, pageButton_, wrenchButton_, - locationBar_, browserActionsContainerView_, nil]; + homeButton_, pageButton_, wrenchButton_, locationBar_, + browserActionsContainerView_, nil]; } // Moves |rect| to the right by |delta|, keeping the right side fixed by @@ -550,20 +546,18 @@ class PrefObserverBridge : public NotificationObserver { if (hide == [pageButton_ isHidden]) return; // Nothing to do, view state matches pref state. - // Shift the go button and resize the text field by the width of the - // page/wrench buttons plus two times the gap width. If we're showing the - // buttons, we have to reverse the direction of movement (to the left). Unlike - // the home button above, we only ever have to resize the text field, we don't - // have to move it. - CGFloat moveX = 2 * [self interButtonSpacing] + NSWidth([pageButton_ frame]) + + // Resize the text field and move the browser actions by the width + // of the page/wrench buttons plus two times the gap width. + CGFloat dX = 2 * [self interButtonSpacing] + NSWidth([pageButton_ frame]) + NSWidth([wrenchButton_ frame]); + // Larger if hiding menus, smaller if showing. if (!hide) - moveX *= -1; // Reverse the direction of the move. + dX *= -1; - [self adjustLocationAndGoPositionsBy:moveX animate:NO]; + [self adjustLocationSizeBy:dX animate:NO]; [browserActionsContainerView_ setFrame:NSOffsetRect( - [browserActionsContainerView_ frame], moveX, 0)]; + [browserActionsContainerView_ frame], dX, 0)]; [browserActionsContainerView_ setRightBorderShown:!hide]; [pageButton_ setHidden:hide]; @@ -608,7 +602,7 @@ class PrefObserverBridge : public NotificationObserver { CGFloat containerWidth = [browserActionsContainerView_ isHidden] ? 0.0 : NSWidth([browserActionsContainerView_ frame]); if (containerWidth > 0.0) - [self adjustLocationAndGoPositionsBy:(containerWidth * -1) animate:NO]; + [self adjustLocationSizeBy:(containerWidth * -1) animate:NO]; BOOL rightBorderShown = !([pageButton_ isHidden] && [wrenchButton_ isHidden]); [browserActionsContainerView_ setRightBorderShown:rightBorderShown]; } @@ -627,37 +621,37 @@ class PrefObserverBridge : public NotificationObserver { locationBarAtMinSize_ = locationBarWidth <= kMinimumLocationBarWidth; [browserActionsContainerView_ setCanDragLeft:!locationBarAtMinSize_]; [browserActionsContainerView_ setGrippyPinned:locationBarAtMinSize_]; - [self adjustLocationAndGoPositionsBy: + [self adjustLocationSizeBy: [browserActionsContainerView_ resizeDeltaX] animate:NO]; } - (void)browserActionsContainerDragFinished:(NSNotification*)notification { [browserActionsController_ resizeContainerAndAnimate:YES]; - [self pinGoButtonToLeftOfBrowserActionsContainerAndAnimate:YES]; + [self pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:YES]; } - (void)browserActionsVisibilityChanged:(NSNotification*)notification { - [self pinGoButtonToLeftOfBrowserActionsContainerAndAnimate:NO]; + [self pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:NO]; } -- (void)pinGoButtonToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate { - CGFloat goXPos = [goButton_ frame].origin.x + NSWidth([goButton_ frame]); +- (void)pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate { + CGFloat locationBarXPos = NSMaxX([locationBar_ frame]); CGFloat leftPadding; if ([browserActionsContainerView_ isHidden]) { CGFloat edgeXPos = [pageButton_ isHidden] ? - NSWidth([[goButton_ window] frame]) : [pageButton_ frame].origin.x; - leftPadding = edgeXPos - goXPos; + NSWidth([[locationBar_ window] frame]) : [pageButton_ frame].origin.x; + leftPadding = edgeXPos - locationBarXPos; } else { NSRect containerFrame = animate ? [browserActionsContainerView_ animationEndFrame] : [browserActionsContainerView_ frame]; - leftPadding = containerFrame.origin.x - goXPos; + leftPadding = containerFrame.origin.x - locationBarXPos; } if (leftPadding != kBrowserActionsContainerLeftPadding) { CGFloat dX = leftPadding - kBrowserActionsContainerLeftPadding; - [self adjustLocationAndGoPositionsBy:dX animate:animate]; + [self adjustLocationSizeBy:dX animate:animate]; } } @@ -666,7 +660,7 @@ class PrefObserverBridge : public NotificationObserver { locationBarAtMinSize_ = locationBarWidth <= kMinimumLocationBarWidth; if (locationBarAtMinSize_) { CGFloat dX = kMinimumLocationBarWidth - locationBarWidth; - [self adjustLocationAndGoPositionsBy:dX animate:NO]; + [self adjustLocationSizeBy:dX animate:NO]; } } @@ -684,7 +678,7 @@ class PrefObserverBridge : public NotificationObserver { NSRect containerFrame = [browserActionsContainerView_ frame]; // Determine how much the container needs to move in case it's overlapping // with the location bar. - CGFloat dX = ([goButton_ frame].origin.x + NSWidth([goButton_ frame])) - + CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x + kBrowserActionsContainerLeftPadding; containerFrame = NSOffsetRect(containerFrame, dX, 0); containerFrame.size.width -= dX; @@ -707,31 +701,22 @@ class PrefObserverBridge : public NotificationObserver { [browserActionsContainerView_ setGrippyPinned:NO]; } [browserActionsContainerView_ setFrame:containerFrame]; - [self pinGoButtonToLeftOfBrowserActionsContainerAndAnimate:NO]; + [self pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:NO]; } } -- (void)adjustLocationAndGoPositionsBy:(CGFloat)dX animate:(BOOL)animate { - // Ensure that the 'Go' button is in its proper place. - NSRect goFrame = [goButton_ frame]; +- (void)adjustLocationSizeBy:(CGFloat)dX animate:(BOOL)animate { + // Ensure that the location bar is in its proper place. NSRect locationFrame = [locationBar_ frame]; - CGFloat rightDelta = (locationFrame.origin.x + NSWidth(locationFrame)) - - goFrame.origin.x; - if (rightDelta != 0.0) - [goButton_ setFrame:NSOffsetRect(goFrame, rightDelta, 0)]; - - goFrame = NSOffsetRect([goButton_ frame], dX, 0); locationFrame.size.width += dX; if (!animate) { - [goButton_ setFrame:goFrame]; [locationBar_ setFrame:locationFrame]; return; } [NSAnimationContext beginGrouping]; [[NSAnimationContext currentContext] setDuration:kAnimationDuration]; - [[goButton_ animator] setFrame:goFrame]; [[locationBar_ animator] setFrame:locationFrame]; [NSAnimationContext endGrouping]; } @@ -766,50 +751,10 @@ class PrefObserverBridge : public NotificationObserver { stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void*)userData { - DCHECK(view == goButton_); - - // Following chrome/browser/views/go_button.cc: GoButton::GetTooltipText() - - // Is it currently 'stop'? - if ([goButton_ tag] == IDC_STOP) { - return l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STOP); - } - - // It is 'go', so see what it would do... - - // Fetch the EditView and EditModel - LocationBar* locationBar = [self locationBarBridge]; - DCHECK(locationBar); - AutocompleteEditView* editView = locationBar->location_entry(); - DCHECK(editView); - AutocompleteEditModel* editModel = editView->model(); - DCHECK(editModel); - - std::wstring currentText(editView->GetText()); - if (currentText.empty()) { - return nil; - } - string16 currentText16(WideToUTF16Hack(currentText)); - - // It is simply an url it is gonna go to, build the tip with the info. - if (editModel->CurrentTextIsURL()) { - return l10n_util::GetNSStringF(IDS_TOOLTIP_GO_SITE, currentText16); - } - - // Build the tip based on what provide/template it will get. - std::wstring keyword(editModel->keyword()); - TemplateURLModel* template_url_model = - editModel->profile()->GetTemplateURLModel(); - const TemplateURL* provider = - (keyword.empty() || editModel->is_keyword_hint()) ? - template_url_model->GetDefaultSearchProvider() : - template_url_model->GetTemplateURLForKeyword(keyword); - if (!provider) - return nil; - std::wstring shortName(provider->AdjustedShortNameForLocaleDirection()); - return l10n_util::GetNSStringF(IDS_TOOLTIP_GO_SEARCH, - WideToUTF16(shortName), currentText16); + DCHECK(view == reloadButton_); + return l10n_util::GetNSStringWithFixup( + [reloadButton_ tag] == IDC_STOP ? IDS_TOOLTIP_STOP : IDS_TOOLTIP_RELOAD); } // (URLDropTargetController protocol) diff --git a/chrome/browser/cocoa/toolbar_controller_unittest.mm b/chrome/browser/cocoa/toolbar_controller_unittest.mm index b02ec0f..b892759 100644 --- a/chrome/browser/cocoa/toolbar_controller_unittest.mm +++ b/chrome/browser/cocoa/toolbar_controller_unittest.mm @@ -43,9 +43,8 @@ class ToolbarControllerTest : public CocoaTest { // Indexes that match the ordering returned by the private ToolbarController // |-toolbarViews| method. enum { - kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex, kGoIndex, - kPageIndex, kWrenchIndex, kLocationIndex, - kBrowserActionContainerViewIndex + kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex, kPageIndex, + kWrenchIndex, kLocationIndex, kBrowserActionContainerViewIndex }; ToolbarControllerTest() { @@ -151,14 +150,14 @@ TEST_F(ToolbarControllerTest, FocusLocation) { } TEST_F(ToolbarControllerTest, LoadingState) { - // In its initial state, the go button has a tag of IDC_GO. When loading, - // it should be IDC_STOP. - NSButton* go = [[bar_ toolbarViews] objectAtIndex:kGoIndex]; - EXPECT_EQ([go tag], IDC_GO); + // In its initial state, the reload button has a tag of + // IDC_RELOAD. When loading, it should be IDC_STOP. + NSButton* reload = [[bar_ toolbarViews] objectAtIndex:kReloadIndex]; + EXPECT_EQ([reload tag], IDC_RELOAD); [bar_ setIsLoading:YES]; - EXPECT_EQ([go tag], IDC_STOP); + EXPECT_EQ([reload tag], IDC_STOP); [bar_ setIsLoading:NO]; - EXPECT_EQ([go tag], IDC_GO); + EXPECT_EQ([reload tag], IDC_RELOAD); } // Check that toggling the state of the home button changes the visible @@ -191,9 +190,7 @@ TEST_F(ToolbarControllerTest, TogglePageWrench) { EXPECT_EQ(showButtons, ![pageButton isHidden]); EXPECT_EQ(showButtons, ![wrenchButton isHidden]); - NSView* goButton = [[bar_ toolbarViews] objectAtIndex:kGoIndex]; NSView* locationBar = [[bar_ toolbarViews] objectAtIndex:kLocationIndex]; - NSRect originalGoFrame = [goButton frame]; NSRect originalLocationBarFrame = [locationBar frame]; // Toggle the pref and make sure the buttons changed state and the other @@ -201,7 +198,6 @@ TEST_F(ToolbarControllerTest, TogglePageWrench) { prefs->SetBoolean(prefs::kShowPageOptionsButtons, !showButtons); EXPECT_EQ(showButtons, [pageButton isHidden]); EXPECT_EQ(showButtons, [wrenchButton isHidden]); - EXPECT_NE(NSMinX(originalGoFrame), NSMinX([goButton frame])); EXPECT_NE(NSWidth(originalLocationBarFrame), NSWidth([locationBar frame])); } |