Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm |
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm |
index ebe9f30dfa53436aa744541f76d1a89b70edf8a2..a6f879ba2ba516f17b5a194adc5c8ba7c05e9a30 100644 |
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm |
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm |
@@ -1387,17 +1387,23 @@ void RecordAppLaunch(Profile* profile, GURL url) { |
} |
-// Adjust the horizontal width and the visibility of the "For quick access" |
-// text field and "Import bookmarks..." button based on the current width |
-// of the containing |buttonView_| (which is affected by window width). |
-- (void)adjustNoItemContainerWidthsForMaxX:(CGFloat)maxViewX { |
+// Adjust the horizontal width, x position and the visibility of the "For quick |
+// access" text field and "Import bookmarks..." button based on the current |
+// width of the containing |buttonView_| (which is affected by window width). |
+- (void)adjustNoItemContainerForMaxX:(CGFloat)maxViewX { |
if (![[buttonView_ noItemContainer] isHidden]) { |
// Reset initial frames for the two items, then adjust as necessary. |
NSTextField* noItemTextfield = [buttonView_ noItemTextfield]; |
- [noItemTextfield setFrame:originalNoItemsRect_]; |
+ NSRect noItemsRect(originalNoItemsRect_); |
Alexei Svitkine (slow)
2013/04/15 21:05:29
Nit: use = instead.
beaudoin
2013/04/16 15:00:22
Done.
|
+ NSRect importBookmarksRect(originalImportBookmarksRect_); |
Alexei Svitkine (slow)
2013/04/15 21:05:29
Nit: use = instead.
beaudoin
2013/04/16 15:00:22
Done.
|
+ if (![appsPageShortcutButton_ isHidden]) { |
+ noItemsRect.origin.x += NSWidth([appsPageShortcutButton_ frame]); |
Alexei Svitkine (slow)
2013/04/15 21:05:29
Use a local variable for width.
beaudoin
2013/04/16 15:00:22
Done.
|
+ importBookmarksRect.origin.x += NSWidth([appsPageShortcutButton_ frame]); |
+ } |
+ [noItemTextfield setFrame:noItemsRect]; |
[noItemTextfield setHidden:NO]; |
NSButton* importBookmarksButton = [buttonView_ importBookmarksButton]; |
- [importBookmarksButton setFrame:originalImportBookmarksRect_]; |
+ [importBookmarksButton setFrame:importBookmarksRect]; |
[importBookmarksButton setHidden:NO]; |
// Check each to see if they need to be shrunk or hidden. |
if ([self shrinkOrHideView:importBookmarksButton forMaxX:maxViewX]) |
@@ -1518,7 +1524,7 @@ void RecordAppLaunch(Profile* profile, GURL url) { |
// While we're here, adjust the horizontal width and the visibility |
// of the "For quick access" and "Import bookmarks..." text fields. |
if (![buttons_ count]) |
- [self adjustNoItemContainerWidthsForMaxX:maxViewX]; |
+ [self adjustNoItemContainerForMaxX:maxViewX]; |
} |
#pragma mark Private Methods Exposed for Testing |