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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_cocoa.mm

Issue 2867823002: [Mac] Hide bookmark bar empty view by default (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_cocoa.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_cocoa.h"
6 6
7 #include "base/metrics/user_metrics.h" 7 #include "base/metrics/user_metrics.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #import "chrome/browser/themes/theme_properties.h" 9 #import "chrome/browser/themes/theme_properties.h"
10 #import "chrome/browser/themes/theme_service.h" 10 #import "chrome/browser/themes/theme_service.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 buttonWithString:l10n_util::GetNSString(IDS_BOOKMARK_BAR_IMPORT_LINK)]; 101 buttonWithString:l10n_util::GetNSString(IDS_BOOKMARK_BAR_IMPORT_LINK)];
102 importBookmarksButton_.reset([importButton retain]); 102 importBookmarksButton_.reset([importButton retain]);
103 [importBookmarksButton_ 103 [importBookmarksButton_
104 setFrame:NSMakeRect(NSMaxX([noItemTextField_ frame]) + 104 setFrame:NSMakeRect(NSMaxX([noItemTextField_ frame]) +
105 kTextFieldTrailingPadding, 105 kTextFieldTrailingPadding,
106 kInitialElementYOrigin, CGFLOAT_MAX, 106 kInitialElementYOrigin, CGFLOAT_MAX,
107 kInitialElementHeight)]; 107 kInitialElementHeight)];
108 [importBookmarksButton_ setFont:smallSystemFont]; 108 [importBookmarksButton_ setFont:smallSystemFont];
109 [importBookmarksButton_ sizeToFit]; 109 [importBookmarksButton_ sizeToFit];
110 110
111 // Hide by default so these don't flash if it takes a while for the bookmark
112 // model to load.
113 [noItemTextField_ setHidden:YES];
114 [importBookmarksButton_ setHidden:YES];
115
111 [self addSubview:noItemTextField_]; 116 [self addSubview:noItemTextField_];
112 [self addSubview:importBookmarksButton_]; 117 [self addSubview:importBookmarksButton_];
113 [self registerForNotificationsAndDraggedTypes]; 118 [self registerForNotificationsAndDraggedTypes];
114 } 119 }
115 return self; 120 return self;
116 } 121 }
117 122
118 - (void)registerForNotificationsAndDraggedTypes { 123 - (void)registerForNotificationsAndDraggedTypes {
119 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; 124 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
120 [defaultCenter addObserver:self 125 [defaultCenter addObserver:self
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 332
328 - (NSMenu*)menu { 333 - (NSMenu*)menu {
329 return [[controller_ menuController] menuForBookmarkBar]; 334 return [[controller_ menuController] menuForBookmarkBar];
330 } 335 }
331 336
332 - (ViewID)viewID { 337 - (ViewID)viewID {
333 return VIEW_ID_BOOKMARK_BAR; 338 return VIEW_ID_BOOKMARK_BAR;
334 } 339 }
335 340
336 @end // @implementation BookmarkBarView 341 @end // @implementation BookmarkBarView
OLDNEW
« 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