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

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

Issue 1739015: Mac BookmarkBubbleController updateBookmarkNode crash. (Closed)
Patch Set: Created 10 years, 7 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/bookmark_bubble_controller.h" 5 #import "chrome/browser/cocoa/bookmark_bubble_controller.h"
6 #include "app/l10n_util_mac.h" 6 #include "app/l10n_util_mac.h"
7 #include "base/mac_util.h" 7 #include "base/mac_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/browser/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #import "chrome/browser/cocoa/browser_window_controller.h" 10 #import "chrome/browser/cocoa/browser_window_controller.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"), 186 UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"),
187 model_->profile()); 187 model_->profile());
188 node_ = NULL; // no longer valid 188 node_ = NULL; // no longer valid
189 [self ok:sender]; 189 [self ok:sender];
190 } 190 }
191 191
192 // The controller is the target of the pop up button box action so it can 192 // The controller is the target of the pop up button box action so it can
193 // handle when "choose another folder" was picked. 193 // handle when "choose another folder" was picked.
194 - (IBAction)folderChanged:(id)sender { 194 - (IBAction)folderChanged:(id)sender {
195 DCHECK([sender isEqual:folderPopUpButton_]); 195 DCHECK([sender isEqual:folderPopUpButton_]);
196 // It is possible that due to model change our parent window has been closed
197 // but the popup is still showing and able to notify the controller of a
198 // folder change. We ignore the sender in this case.
199 if (!parentWindow_)
200 return;
196 NSMenuItem* selected = [folderPopUpButton_ selectedItem]; 201 NSMenuItem* selected = [folderPopUpButton_ selectedItem];
197 ChooseAnotherFolder* chooseItem = [[self class] chooseAnotherFolderObject]; 202 ChooseAnotherFolder* chooseItem = [[self class] chooseAnotherFolderObject];
198 if ([[selected representedObject] isEqual:chooseItem]) { 203 if ([[selected representedObject] isEqual:chooseItem]) {
199 UserMetrics::RecordAction( 204 UserMetrics::RecordAction(
200 UserMetricsAction("BookmarkBubble_EditFromCombobox"), 205 UserMetricsAction("BookmarkBubble_EditFromCombobox"),
201 model_->profile()); 206 model_->profile());
202 [self showEditor]; 207 [self showEditor];
203 } 208 }
204 } 209 }
205 210
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; 323 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue];
319 DCHECK(idx != -1); 324 DCHECK(idx != -1);
320 [folderPopUpButton_ selectItemAtIndex:idx]; 325 [folderPopUpButton_ selectItemAtIndex:idx];
321 } 326 }
322 327
323 - (NSPopUpButton*)folderPopUpButton { 328 - (NSPopUpButton*)folderPopUpButton {
324 return folderPopUpButton_; 329 return folderPopUpButton_;
325 } 330 }
326 331
327 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) 332 @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