| 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/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 model_ = model; | 58 model_ = model; |
| 59 node_ = node; | 59 node_ = node; |
| 60 alreadyBookmarked_ = alreadyBookmarked; | 60 alreadyBookmarked_ = alreadyBookmarked; |
| 61 } | 61 } |
| 62 return self; | 62 return self; |
| 63 } | 63 } |
| 64 | 64 |
| 65 - (void)awakeFromNib { | 65 - (void)awakeFromNib { |
| 66 [super awakeFromNib]; | 66 [super awakeFromNib]; |
| 67 | 67 |
| 68 // Check if NSTextFieldCell supports the method. This check is in place as | 68 [[nameTextField_ cell] setUsesSingleLineMode:YES]; |
| 69 // only 10.6 and greater support the setUsesSingleLineMode method. | |
| 70 // TODO(kushi.p): Remove this when the project hits a 10.6+ only state. | |
| 71 NSTextFieldCell* nameFieldCell_ = [nameTextField_ cell]; | |
| 72 if ([nameFieldCell_ | |
| 73 respondsToSelector:@selector(setUsesSingleLineMode:)]) { | |
| 74 [nameFieldCell_ setUsesSingleLineMode:YES]; | |
| 75 } | |
| 76 } | 69 } |
| 77 | 70 |
| 78 // If this is a new bookmark somewhere visible (e.g. on the bookmark | 71 // If this is a new bookmark somewhere visible (e.g. on the bookmark |
| 79 // bar), pulse it. Else, call ourself recursively with our parent | 72 // bar), pulse it. Else, call ourself recursively with our parent |
| 80 // until we find something visible to pulse. | 73 // until we find something visible to pulse. |
| 81 - (void)startPulsingBookmarkButton:(const BookmarkNode*)node { | 74 - (void)startPulsingBookmarkButton:(const BookmarkNode*)node { |
| 82 while (node) { | 75 while (node) { |
| 83 if ((node->parent() == model_->bookmark_bar_node()) || | 76 if ((node->parent() == model_->bookmark_bar_node()) || |
| 84 (node == model_->other_node())) { | 77 (node == model_->other_node())) { |
| 85 pulsingBookmarkNode_ = node; | 78 pulsingBookmarkNode_ = node; |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; | 352 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; |
| 360 DCHECK(idx != -1); | 353 DCHECK(idx != -1); |
| 361 [folderPopUpButton_ selectItemAtIndex:idx]; | 354 [folderPopUpButton_ selectItemAtIndex:idx]; |
| 362 } | 355 } |
| 363 | 356 |
| 364 - (NSPopUpButton*)folderPopUpButton { | 357 - (NSPopUpButton*)folderPopUpButton { |
| 365 return folderPopUpButton_; | 358 return folderPopUpButton_; |
| 366 } | 359 } |
| 367 | 360 |
| 368 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) | 361 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) |
| OLD | NEW |