| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |