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_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_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/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" | 10 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 325 } |
326 | 326 |
327 // Fill in all information related to the folder pop up button. | 327 // Fill in all information related to the folder pop up button. |
328 - (void)fillInFolderList { | 328 - (void)fillInFolderList { |
329 [nameTextField_ setStringValue:base::SysUTF16ToNSString(node_->GetTitle())]; | 329 [nameTextField_ setStringValue:base::SysUTF16ToNSString(node_->GetTitle())]; |
330 DCHECK([folderPopUpButton_ numberOfItems] == 0); | 330 DCHECK([folderPopUpButton_ numberOfItems] == 0); |
331 [self addFolderNodes:model_->root_node() | 331 [self addFolderNodes:model_->root_node() |
332 toPopUpButton:folderPopUpButton_ | 332 toPopUpButton:folderPopUpButton_ |
333 indentation:0]; | 333 indentation:0]; |
334 NSMenu* menu = [folderPopUpButton_ menu]; | 334 NSMenu* menu = [folderPopUpButton_ menu]; |
| 335 [menu addItem:[NSMenuItem separatorItem]]; |
335 NSString* title = [[self class] chooseAnotherFolderString]; | 336 NSString* title = [[self class] chooseAnotherFolderString]; |
336 NSMenuItem *item = [menu addItemWithTitle:title | 337 NSMenuItem *item = [menu addItemWithTitle:title |
337 action:NULL | 338 action:NULL |
338 keyEquivalent:@""]; | 339 keyEquivalent:@""]; |
339 ChooseAnotherFolder* obj = [[self class] chooseAnotherFolderObject]; | 340 ChooseAnotherFolder* obj = [[self class] chooseAnotherFolderObject]; |
340 [item setRepresentedObject:obj]; | 341 [item setRepresentedObject:obj]; |
341 // Finally, select the current parent. | 342 // Finally, select the current parent. |
342 NSValue* parentValue = [NSValue valueWithPointer:node_->parent()]; | 343 NSValue* parentValue = [NSValue valueWithPointer:node_->parent()]; |
343 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; | 344 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; |
344 [folderPopUpButton_ selectItemAtIndex:idx]; | 345 [folderPopUpButton_ selectItemAtIndex:idx]; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; | 400 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; |
400 DCHECK(idx != -1); | 401 DCHECK(idx != -1); |
401 [folderPopUpButton_ selectItemAtIndex:idx]; | 402 [folderPopUpButton_ selectItemAtIndex:idx]; |
402 } | 403 } |
403 | 404 |
404 - (NSPopUpButton*)folderPopUpButton { | 405 - (NSPopUpButton*)folderPopUpButton { |
405 return folderPopUpButton_; | 406 return folderPopUpButton_; |
406 } | 407 } |
407 | 408 |
408 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) | 409 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) |
OLD | NEW |