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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 243 } |
244 | 244 |
245 // By implementing this, ESC causes the window to go away. If clicking the | 245 // By implementing this, ESC causes the window to go away. If clicking the |
246 // star was what prompted this bubble to appear (i.e., not already bookmarked), | 246 // star was what prompted this bubble to appear (i.e., not already bookmarked), |
247 // remove the bookmark. | 247 // remove the bookmark. |
248 - (IBAction)cancel:(id)sender { | 248 - (IBAction)cancel:(id)sender { |
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 stopPulsingBookmarkButton]; |
| 254 [self dismissWithoutEditing:nil]; |
254 } | 255 } |
255 } | 256 } |
256 | 257 |
257 - (IBAction)remove:(id)sender { | 258 - (IBAction)remove:(id)sender { |
258 [self stopPulsingBookmarkButton]; | 259 [self stopPulsingBookmarkButton]; |
259 bookmarks::RemoveAllBookmarks(model_, node_->url()); | 260 bookmarks::RemoveAllBookmarks(model_, node_->url()); |
260 content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar")); | 261 content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar")); |
261 node_ = NULL; // no longer valid | 262 node_ = NULL; // no longer valid |
262 [self ok:sender]; | 263 [self ok:sender]; |
263 } | 264 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; | 401 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; |
401 DCHECK(idx != -1); | 402 DCHECK(idx != -1); |
402 [folderPopUpButton_ selectItemAtIndex:idx]; | 403 [folderPopUpButton_ selectItemAtIndex:idx]; |
403 } | 404 } |
404 | 405 |
405 - (NSPopUpButton*)folderPopUpButton { | 406 - (NSPopUpButton*)folderPopUpButton { |
406 return folderPopUpButton_; | 407 return folderPopUpButton_; |
407 } | 408 } |
408 | 409 |
409 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) | 410 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) |
OLD | NEW |