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

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

Issue 1221173003: [Mac] Inform reference counted objects that hold a weak Browser* when the Browser is being destroye… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dealloc override. Created 5 years, 5 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
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_bar_controller.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
6 6
7 #include "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 initWithBookmarkBarController:self]); 293 initWithBookmarkBarController:self]);
294 294
295 // This call triggers an -awakeFromNib, which builds the bar, which might 295 // This call triggers an -awakeFromNib, which builds the bar, which might
296 // use |folderImage_| and |contextMenuController_|. Ensure it happens after 296 // use |folderImage_| and |contextMenuController_|. Ensure it happens after
297 // |folderImage_| is loaded and |contextMenuController_| is created. 297 // |folderImage_| is loaded and |contextMenuController_| is created.
298 [[self animatableView] setResizeDelegate:resizeDelegate]; 298 [[self animatableView] setResizeDelegate:resizeDelegate];
299 } 299 }
300 return self; 300 return self;
301 } 301 }
302 302
303 - (void)browserWillBeDestroyed {
304 browser_ = nullptr;
305 }
306
303 - (Browser*)browser { 307 - (Browser*)browser {
304 return browser_; 308 return browser_;
305 } 309 }
306 310
307 - (BookmarkContextMenuCocoaController*)menuController { 311 - (BookmarkContextMenuCocoaController*)menuController {
308 return contextMenuController_.get(); 312 return contextMenuController_.get();
309 } 313 }
310 314
311 - (void)pulseBookmarkNotification:(NSNotification*)notification { 315 - (void)pulseBookmarkNotification:(NSNotification*)notification {
312 NSDictionary* dict = [notification userInfo]; 316 NSDictionary* dict = [notification userInfo];
(...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after
2902 - (id<BookmarkButtonControllerProtocol>)controllerForNode: 2906 - (id<BookmarkButtonControllerProtocol>)controllerForNode:
2903 (const BookmarkNode*)node { 2907 (const BookmarkNode*)node {
2904 // See if it's in the bar, then if it is in the hierarchy of visible 2908 // See if it's in the bar, then if it is in the hierarchy of visible
2905 // folder menus. 2909 // folder menus.
2906 if (bookmarkModel_->bookmark_bar_node() == node) 2910 if (bookmarkModel_->bookmark_bar_node() == node)
2907 return self; 2911 return self;
2908 return [folderController_ controllerForNode:node]; 2912 return [folderController_ controllerForNode:node];
2909 } 2913 }
2910 2914
2911 @end 2915 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698