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_folder_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_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/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 } | 355 } |
356 | 356 |
357 #pragma mark Private Methods | 357 #pragma mark Private Methods |
358 | 358 |
359 - (BookmarkButtonCell*)cellForBookmarkNode:(const BookmarkNode*)child { | 359 - (BookmarkButtonCell*)cellForBookmarkNode:(const BookmarkNode*)child { |
360 NSImage* image = child ? [barController_ faviconForNode:child] : nil; | 360 NSImage* image = child ? [barController_ faviconForNode:child] : nil; |
361 BookmarkContextMenuCocoaController* menuController = | 361 BookmarkContextMenuCocoaController* menuController = |
362 [barController_ menuController]; | 362 [barController_ menuController]; |
363 BookmarkBarFolderButtonCell* cell = | 363 BookmarkBarFolderButtonCell* cell = |
364 [BookmarkBarFolderButtonCell buttonCellForNode:child | 364 [BookmarkBarFolderButtonCell buttonCellForNode:child |
365 menuController:menuController | 365 text:nil |
366 cellText:nil | 366 image:image |
367 cellImage:image]; | 367 menuController:menuController]; |
368 [cell setTag:kStandardButtonTypeWithLimitedClickFeedback]; | 368 [cell setTag:kStandardButtonTypeWithLimitedClickFeedback]; |
369 return cell; | 369 return cell; |
370 } | 370 } |
371 | 371 |
372 // Redirect to our logic shared with BookmarkBarController. | 372 // Redirect to our logic shared with BookmarkBarController. |
373 - (IBAction)openBookmarkFolderFromButton:(id)sender { | 373 - (IBAction)openBookmarkFolderFromButton:(id)sender { |
374 [folderTarget_ openBookmarkFolderFromButton:sender]; | 374 [folderTarget_ openBookmarkFolderFromButton:sender]; |
375 } | 375 } |
376 | 376 |
377 // Create a bookmark button for the given node using frame. | 377 // Create a bookmark button for the given node using frame. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 DCHECK(button); | 415 DCHECK(button); |
416 | 416 |
417 [button setCell:cell]; | 417 [button setCell:cell]; |
418 [button setDelegate:self]; | 418 [button setDelegate:self]; |
419 if (node) { | 419 if (node) { |
420 if (node->is_folder()) { | 420 if (node->is_folder()) { |
421 [button setTarget:self]; | 421 [button setTarget:self]; |
422 [button setAction:@selector(openBookmarkFolderFromButton:)]; | 422 [button setAction:@selector(openBookmarkFolderFromButton:)]; |
423 } else { | 423 } else { |
424 // Make the button do something. | 424 // Make the button do something. |
425 [button setTarget:barController_]; | 425 [button setTarget:barController_]; |
Alexei Svitkine (slow)
2013/03/11 21:06:43
That shouldn't be showing up the diff, is your bas
beaudoin
2013/03/11 21:29:56
Hmmm, it seems ok, and no diff show up here for me
Alexei Svitkine (slow)
2013/03/11 21:39:54
Ah, that was it, my bad!
| |
426 [button setAction:@selector(openBookmark:)]; | 426 [button setAction:@selector(openBookmark:)]; |
427 // Add a tooltip. | 427 // Add a tooltip. |
428 [button setToolTip:[BookmarkMenuCocoaController tooltipForNode:node]]; | 428 [button setToolTip:[BookmarkMenuCocoaController tooltipForNode:node]]; |
429 [button setAcceptsTrackIn:YES]; | 429 [button setAcceptsTrackIn:YES]; |
430 } | 430 } |
431 } else { | 431 } else { |
432 [button setEnabled:NO]; | 432 [button setEnabled:NO]; |
433 [button setBordered:NO]; | 433 [button setBordered:NO]; |
434 } | 434 } |
435 return button; | 435 return button; |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1965 | 1965 |
1966 - (void)setIgnoreAnimations:(BOOL)ignore { | 1966 - (void)setIgnoreAnimations:(BOOL)ignore { |
1967 ignoreAnimations_ = ignore; | 1967 ignoreAnimations_ = ignore; |
1968 } | 1968 } |
1969 | 1969 |
1970 - (BookmarkButton*)buttonThatMouseIsIn { | 1970 - (BookmarkButton*)buttonThatMouseIsIn { |
1971 return buttonThatMouseIsIn_; | 1971 return buttonThatMouseIsIn_; |
1972 } | 1972 } |
1973 | 1973 |
1974 @end // BookmarkBarFolderController | 1974 @end // BookmarkBarFolderController |
OLD | NEW |