OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
6 | 6 |
7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 350 |
351 - (void)awakeFromNib { | 351 - (void)awakeFromNib { |
352 // We default to NOT open, which means height=0. | 352 // We default to NOT open, which means height=0. |
353 DCHECK([[self view] isHidden]); // Hidden so it's OK to change. | 353 DCHECK([[self view] isHidden]); // Hidden so it's OK to change. |
354 | 354 |
355 // Set our initial height to zero, since that is what the superview | 355 // Set our initial height to zero, since that is what the superview |
356 // expects. We will resize ourselves open later if needed. | 356 // expects. We will resize ourselves open later if needed. |
357 [[self view] setFrame:NSMakeRect(0, 0, initialWidth_, 0)]; | 357 [[self view] setFrame:NSMakeRect(0, 0, initialWidth_, 0)]; |
358 | 358 |
359 // Complete init of the "off the side" button, as much as we can. | 359 // Complete init of the "off the side" button, as much as we can. |
| 360 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 361 [offTheSideButton_ setImage: |
| 362 rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_CHEVRONS).ToNSImage()]; |
360 [offTheSideButton_.draggableButton setDraggable:NO]; | 363 [offTheSideButton_.draggableButton setDraggable:NO]; |
361 [offTheSideButton_.draggableButton setActsOnMouseDown:YES]; | 364 [offTheSideButton_.draggableButton setActsOnMouseDown:YES]; |
362 | 365 |
363 // We are enabled by default. | 366 // We are enabled by default. |
364 barIsEnabled_ = YES; | 367 barIsEnabled_ = YES; |
365 | 368 |
366 // Remember the original sizes of the 'no items' and 'import bookmarks' | 369 // Remember the original sizes of the 'no items' and 'import bookmarks' |
367 // fields to aid in resizing when the window frame changes. | 370 // fields to aid in resizing when the window frame changes. |
368 originalNoItemsRect_ = [[buttonView_ noItemTextfield] frame]; | 371 originalNoItemsRect_ = [[buttonView_ noItemTextfield] frame]; |
369 originalImportBookmarksRect_ = [[buttonView_ importBookmarksButton] frame]; | 372 originalImportBookmarksRect_ = [[buttonView_ importBookmarksButton] frame]; |
(...skipping 2474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2844 // to minimize touching the object passed in (likely a mock). | 2847 // to minimize touching the object passed in (likely a mock). |
2845 - (void)setButtonContextMenu:(id)menu { | 2848 - (void)setButtonContextMenu:(id)menu { |
2846 buttonContextMenu_ = menu; | 2849 buttonContextMenu_ = menu; |
2847 } | 2850 } |
2848 | 2851 |
2849 - (void)setIgnoreAnimations:(BOOL)ignore { | 2852 - (void)setIgnoreAnimations:(BOOL)ignore { |
2850 ignoreAnimations_ = ignore; | 2853 ignoreAnimations_ = ignore; |
2851 } | 2854 } |
2852 | 2855 |
2853 @end | 2856 @end |
OLD | NEW |