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

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

Issue 267082: Makes it so when NSViewControllers go away that they remove their views from ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/cocoa/download_shelf_controller.mm » ('j') | 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 #include "app/l10n_util_mac.h" 5 #include "app/l10n_util_mac.h"
6 #include "app/resource_bundle.h" 6 #include "app/resource_bundle.h"
7 #include "base/mac_util.h" 7 #include "base/mac_util.h"
8 #include "base/nsimage_cache_mac.h" 8 #include "base/nsimage_cache_mac.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "chrome/browser/bookmarks/bookmark_editor.h" 10 #include "chrome/browser/bookmarks/bookmark_editor.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 tabObserver_.reset( 83 tabObserver_.reset(
84 new TabStripModelObserverBridge(browser_->tabstrip_model(), self)); 84 new TabStripModelObserverBridge(browser_->tabstrip_model(), self));
85 85
86 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 86 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
87 folderImage_.reset([rb.GetNSImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]); 87 folderImage_.reset([rb.GetNSImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]);
88 } 88 }
89 return self; 89 return self;
90 } 90 }
91 91
92 - (void)dealloc { 92 - (void)dealloc {
93 // Remove our view from its superview so it doesn't attempt to reference
94 // it when the controller is gone.
95 [[self view] removeFromSuperview];
93 bridge_.reset(NULL); 96 bridge_.reset(NULL);
94 [[NSNotificationCenter defaultCenter] removeObserver:self]; 97 [[NSNotificationCenter defaultCenter] removeObserver:self];
95 [super dealloc]; 98 [super dealloc];
96 } 99 }
97 100
98 - (void)awakeFromNib { 101 - (void)awakeFromNib {
99 // We default to NOT open, which means height=0. 102 // We default to NOT open, which means height=0.
100 DCHECK([[self view] isHidden]); // Hidden so it's OK to change. 103 DCHECK([[self view] isHidden]); // Hidden so it's OK to change.
101 104
102 // Set our initial height to zero, since that is what the superview 105 // Set our initial height to zero, since that is what the superview
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 738
736 - (void)setUrlDelegate:(id<BookmarkURLOpener>)urlDelegate { 739 - (void)setUrlDelegate:(id<BookmarkURLOpener>)urlDelegate {
737 urlDelegate_ = urlDelegate; 740 urlDelegate_ = urlDelegate;
738 } 741 }
739 742
740 - (NSArray*)buttons { 743 - (NSArray*)buttons {
741 return buttons_.get(); 744 return buttons_.get();
742 } 745 }
743 746
744 @end 747 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/download_shelf_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698