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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm

Issue 14262013: On Mac, ensure messages displayed in the bookmark bar do not overlap with the Apps bookmark button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698