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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm

Issue 1588703002: Slight clean-up of the bookmark bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
index dd9a9bb39ba0e291b9f9e32f9279620fbc35cc41..f78e17a2cb969218be13c7a743c2c670e756e942 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
@@ -30,13 +30,6 @@ using base::UserMetricsAction;
using bookmarks::BookmarkModel;
using bookmarks::BookmarkNode;
-// An object to represent the ChooseAnotherFolder item in the pop up.
-@interface ChooseAnotherFolder : NSObject
-@end
-
-@implementation ChooseAnotherFolder
-@end
-
@interface BookmarkBubbleController (PrivateAPI)
- (void)updateBookmarkNode;
- (void)fillInFolderList;
@@ -46,13 +39,10 @@ using bookmarks::BookmarkNode;
@synthesize node = node_;
-+ (id)chooseAnotherFolderObject {
// Singleton object to act as a representedObject for the "choose another
// folder" item in the pop up.
- static ChooseAnotherFolder* object = nil;
- if (!object) {
- object = [[ChooseAnotherFolder alloc] init];
- }
++ (id)chooseAnotherFolderObject {
+ static id object = [[NSObject alloc] init];
return object;
}
@@ -240,8 +230,8 @@ using bookmarks::BookmarkNode;
if (!self.parentWindow)
return;
NSMenuItem* selected = [folderPopUpButton_ selectedItem];
- ChooseAnotherFolder* chooseItem = [[self class] chooseAnotherFolderObject];
- if ([[selected representedObject] isEqual:chooseItem]) {
+ if ([selected representedObject] ==
+ [[self class] chooseAnotherFolderObject]) {
content::RecordAction(
UserMetricsAction("BookmarkBubble_EditFromCombobox"));
[self showEditor];
@@ -278,7 +268,7 @@ using bookmarks::BookmarkNode;
const BookmarkNode* oldParent = node_->parent();
NSMenuItem* selectedItem = [folderPopUpButton_ selectedItem];
id representedObject = [selectedItem representedObject];
- if ([representedObject isEqual:[[self class] chooseAnotherFolderObject]]) {
+ if (representedObject == [[self class] chooseAnotherFolderObject]) {
// "Choose another folder..."
return;
}
@@ -305,8 +295,7 @@ using bookmarks::BookmarkNode;
NSMenuItem *item = [menu addItemWithTitle:title
action:NULL
keyEquivalent:@""];
- ChooseAnotherFolder* obj = [[self class] chooseAnotherFolderObject];
- [item setRepresentedObject:obj];
+ [item setRepresentedObject:[[self class] chooseAnotherFolderObject]];
// Finally, select the current parent.
NSValue* parentValue = [NSValue valueWithPointer:node_->parent()];
NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698