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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm

Issue 592323002: [Mac] On pressing Esc key, close Bookmark Bubble without editing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« 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