| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 browser_ = browser; | 244 browser_ = browser; |
| 245 initialWidth_ = initialWidth; | 245 initialWidth_ = initialWidth; |
| 246 bookmarkModel_ = BookmarkModelFactory::GetForProfile(browser_->profile()); | 246 bookmarkModel_ = BookmarkModelFactory::GetForProfile(browser_->profile()); |
| 247 buttons_.reset([[NSMutableArray alloc] init]); | 247 buttons_.reset([[NSMutableArray alloc] init]); |
| 248 delegate_ = delegate; | 248 delegate_ = delegate; |
| 249 resizeDelegate_ = resizeDelegate; | 249 resizeDelegate_ = resizeDelegate; |
| 250 folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]); | 250 folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]); |
| 251 | 251 |
| 252 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 252 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 253 folderImage_.reset( | 253 folderImage_.reset( |
| 254 [rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]); | 254 rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER).CopyNSImage()); |
| 255 defaultImage_.reset([rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON) retain]); | 255 defaultImage_.reset( |
| 256 rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).CopyNSImage()); |
| 256 | 257 |
| 257 // Register for theme changes, bookmark button pulsing, ... | 258 // Register for theme changes, bookmark button pulsing, ... |
| 258 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; | 259 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; |
| 259 [defaultCenter addObserver:self | 260 [defaultCenter addObserver:self |
| 260 selector:@selector(themeDidChangeNotification:) | 261 selector:@selector(themeDidChangeNotification:) |
| 261 name:kBrowserThemeDidChangeNotification | 262 name:kBrowserThemeDidChangeNotification |
| 262 object:nil]; | 263 object:nil]; |
| 263 [defaultCenter addObserver:self | 264 [defaultCenter addObserver:self |
| 264 selector:@selector(pulseBookmarkNotification:) | 265 selector:@selector(pulseBookmarkNotification:) |
| 265 name:bookmark_button::kPulseBookmarkButtonNotification | 266 name:bookmark_button::kPulseBookmarkButtonNotification |
| (...skipping 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2834 // to minimize touching the object passed in (likely a mock). | 2835 // to minimize touching the object passed in (likely a mock). |
| 2835 - (void)setButtonContextMenu:(id)menu { | 2836 - (void)setButtonContextMenu:(id)menu { |
| 2836 buttonContextMenu_ = menu; | 2837 buttonContextMenu_ = menu; |
| 2837 } | 2838 } |
| 2838 | 2839 |
| 2839 - (void)setIgnoreAnimations:(BOOL)ignore { | 2840 - (void)setIgnoreAnimations:(BOOL)ignore { |
| 2840 ignoreAnimations_ = ignore; | 2841 ignoreAnimations_ = ignore; |
| 2841 } | 2842 } |
| 2842 | 2843 |
| 2843 @end | 2844 @end |
| OLD | NEW |