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

Side by Side Diff: chrome/browser/cocoa/bookmark_bar_controller.mm

Issue 348018: Foo. (Closed)
Patch Set: Created 11 years, 1 month 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 | chrome/browser/cocoa/bookmark_button_cell.mm » ('j') | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "app/l10n_util_mac.h" 5 #include "app/l10n_util_mac.h"
6 #include "app/resource_bundle.h" 6 #include "app/resource_bundle.h"
7 #include "base/mac_util.h" 7 #include "base/mac_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/browser/bookmarks/bookmark_editor.h" 9 #include "chrome/browser/bookmarks/bookmark_editor.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 - (void)clearBookmarkBar { 537 - (void)clearBookmarkBar {
538 [buttons_ makeObjectsPerformSelector:@selector(removeFromSuperview)]; 538 [buttons_ makeObjectsPerformSelector:@selector(removeFromSuperview)];
539 [buttons_ removeAllObjects]; 539 [buttons_ removeAllObjects];
540 [self clearMenuTagMap]; 540 [self clearMenuTagMap];
541 } 541 }
542 542
543 // Return an autoreleased NSCell suitable for a bookmark button. 543 // Return an autoreleased NSCell suitable for a bookmark button.
544 // TODO(jrg): move much of the cell config into the BookmarkButtonCell class. 544 // TODO(jrg): move much of the cell config into the BookmarkButtonCell class.
545 - (NSCell*)cellForBookmarkNode:(const BookmarkNode*)node { 545 - (NSCell*)cellForBookmarkNode:(const BookmarkNode*)node {
546 NSString* title = base::SysWideToNSString(node->GetTitle()); 546 NSString* title = base::SysWideToNSString(node->GetTitle());
547 NSButtonCell *cell = [[[BookmarkButtonCell alloc] initTextCell:nil] 547 BookmarkButtonCell *cell = [[[BookmarkButtonCell alloc] initTextCell:nil]
548 autorelease]; 548 autorelease];
549 DCHECK(cell); 549 DCHECK(cell);
550 [cell setRepresentedObject:[NSValue valueWithPointer:node]]; 550 [cell setRepresentedObject:[NSValue valueWithPointer:node]];
551 551
552 NSImage* image = NULL; 552 NSImage* image = NULL;
553 if (node->is_folder()) { 553 if (node->is_folder()) {
554 image = folderImage_; 554 image = folderImage_;
555 } else { 555 } else {
556 const SkBitmap& favicon = bookmarkModel_->GetFavIcon(node); 556 const SkBitmap& favicon = bookmarkModel_->GetFavIcon(node);
557 if (!favicon.isNull()) { 557 if (!favicon.isNull()) {
558 image = gfx::SkBitmapToNSImage(favicon); 558 image = gfx::SkBitmapToNSImage(favicon);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 761
762 - (void)setUrlDelegate:(id<BookmarkURLOpener>)urlDelegate { 762 - (void)setUrlDelegate:(id<BookmarkURLOpener>)urlDelegate {
763 urlDelegate_ = urlDelegate; 763 urlDelegate_ = urlDelegate;
764 } 764 }
765 765
766 - (NSArray*)buttons { 766 - (NSArray*)buttons {
767 return buttons_.get(); 767 return buttons_.get();
768 } 768 }
769 769
770 @end 770 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/bookmark_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698