| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 if (!alreadyBookmarked_) { | 249 if (!alreadyBookmarked_) { |
| 250 // |-remove:| calls |-close| so don't do it. | 250 // |-remove:| calls |-close| so don't do it. |
| 251 [self remove:sender]; | 251 [self remove:sender]; |
| 252 } else { | 252 } else { |
| 253 [self ok:sender]; | 253 [self ok:sender]; |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 | 256 |
| 257 - (IBAction)remove:(id)sender { | 257 - (IBAction)remove:(id)sender { |
| 258 [self stopPulsingBookmarkButton]; | 258 [self stopPulsingBookmarkButton]; |
| 259 bookmark_utils::RemoveAllBookmarks(model_, node_->url()); | 259 bookmarks::RemoveAllBookmarks(model_, node_->url()); |
| 260 content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar")); | 260 content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar")); |
| 261 node_ = NULL; // no longer valid | 261 node_ = NULL; // no longer valid |
| 262 [self ok:sender]; | 262 [self ok:sender]; |
| 263 } | 263 } |
| 264 | 264 |
| 265 // The controller is the target of the pop up button box action so it can | 265 // The controller is the target of the pop up button box action so it can |
| 266 // handle when "choose another folder" was picked. | 266 // handle when "choose another folder" was picked. |
| 267 - (IBAction)folderChanged:(id)sender { | 267 - (IBAction)folderChanged:(id)sender { |
| 268 DCHECK([sender isEqual:folderPopUpButton_]); | 268 DCHECK([sender isEqual:folderPopUpButton_]); |
| 269 // It is possible that due to model change our parent window has been closed | 269 // It is possible that due to model change our parent window has been closed |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; | 399 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; |
| 400 DCHECK(idx != -1); | 400 DCHECK(idx != -1); |
| 401 [folderPopUpButton_ selectItemAtIndex:idx]; | 401 [folderPopUpButton_ selectItemAtIndex:idx]; |
| 402 } | 402 } |
| 403 | 403 |
| 404 - (NSPopUpButton*)folderPopUpButton { | 404 - (NSPopUpButton*)folderPopUpButton { |
| 405 return folderPopUpButton_; | 405 return folderPopUpButton_; |
| 406 } | 406 } |
| 407 | 407 |
| 408 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) | 408 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) |
| OLD | NEW |