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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm

Issue 7530024: bookmarks: Simplify is_permanent_node() implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use is_root_node Created 9 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model.cc ('k') | no next file » | 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) 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_bubble_controller.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h"
6 6
7 #include "base/mac/mac_util.h" 7 #include "base/mac/mac_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/browser/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 + (NSString*)chooseAnotherFolderString { 371 + (NSString*)chooseAnotherFolderString {
372 return l10n_util::GetNSStringWithFixup( 372 return l10n_util::GetNSStringWithFixup(
373 IDS_BOOMARK_BUBBLE_CHOOSER_ANOTHER_FOLDER); 373 IDS_BOOMARK_BUBBLE_CHOOSER_ANOTHER_FOLDER);
374 } 374 }
375 375
376 // For the given folder node, walk the tree and add folder names to 376 // For the given folder node, walk the tree and add folder names to
377 // the given pop up button. 377 // the given pop up button.
378 - (void)addFolderNodes:(const BookmarkNode*)parent 378 - (void)addFolderNodes:(const BookmarkNode*)parent
379 toPopUpButton:(NSPopUpButton*)button 379 toPopUpButton:(NSPopUpButton*)button
380 indentation:(int)indentation { 380 indentation:(int)indentation {
381 if (!model_->is_root(parent)) { 381 if (!model_->is_root_node(parent)) {
382 NSString* title = base::SysUTF16ToNSString(parent->GetTitle()); 382 NSString* title = base::SysUTF16ToNSString(parent->GetTitle());
383 NSMenu* menu = [button menu]; 383 NSMenu* menu = [button menu];
384 NSMenuItem* item = [menu addItemWithTitle:title 384 NSMenuItem* item = [menu addItemWithTitle:title
385 action:NULL 385 action:NULL
386 keyEquivalent:@""]; 386 keyEquivalent:@""];
387 [item setRepresentedObject:[NSValue valueWithPointer:parent]]; 387 [item setRepresentedObject:[NSValue valueWithPointer:parent]];
388 [item setIndentationLevel:indentation]; 388 [item setIndentationLevel:indentation];
389 ++indentation; 389 ++indentation;
390 } 390 }
391 for (int i = 0; i < parent->child_count(); i++) { 391 for (int i = 0; i < parent->child_count(); i++) {
(...skipping 20 matching lines...) Expand all
412 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; 412 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue];
413 DCHECK(idx != -1); 413 DCHECK(idx != -1);
414 [folderPopUpButton_ selectItemAtIndex:idx]; 414 [folderPopUpButton_ selectItemAtIndex:idx];
415 } 415 }
416 416
417 - (NSPopUpButton*)folderPopUpButton { 417 - (NSPopUpButton*)folderPopUpButton {
418 return folderPopUpButton_; 418 return folderPopUpButton_;
419 } 419 }
420 420
421 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) 421 @end // implementation BookmarkBubbleController(ExposedForUnitTesting)
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698