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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/avatar_base_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: Keep -[BookmarBarController dealloc] instead of changing all the tests. 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/profiles/avatar_base_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 10 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 - (id)initWithBrowser:(Browser*)browser { 124 - (id)initWithBrowser:(Browser*)browser {
125 if ((self = [super init])) { 125 if ((self = [super init])) {
126 browser_ = browser; 126 browser_ = browser;
127 profileInfoObserver_.reset( 127 profileInfoObserver_.reset(
128 new ProfileInfoUpdateObserver(browser_->profile(), self)); 128 new ProfileInfoUpdateObserver(browser_->profile(), self));
129 } 129 }
130 return self; 130 return self;
131 } 131 }
132 132
133 - (void)dealloc { 133 - (void)browserWillBeDestroyed {
134 [[NSNotificationCenter defaultCenter] 134 [[NSNotificationCenter defaultCenter]
135 removeObserver:self 135 removeObserver:self
136 name:NSWindowWillCloseNotification 136 name:NSWindowWillCloseNotification
137 object:[menuController_ window]]; 137 object:[menuController_ window]];
138 [super dealloc]; 138 browser_ = nullptr;
139 } 139 }
140 140
141 - (NSButton*)buttonView { 141 - (NSButton*)buttonView {
142 CHECK(button_.get()); // Subclasses must set this. 142 CHECK(button_.get()); // Subclasses must set this.
143 return button_.get(); 143 return button_.get();
144 } 144 }
145 145
146 - (void)showAvatarBubbleAnchoredAt:(NSView*)anchor 146 - (void)showAvatarBubbleAnchoredAt:(NSView*)anchor
147 withMode:(BrowserWindow::AvatarBubbleMode)mode 147 withMode:(BrowserWindow::AvatarBubbleMode)mode
148 withServiceType:(signin::GAIAServiceType)serviceType { 148 withServiceType:(signin::GAIAServiceType)serviceType {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } 255 }
256 256
257 - (void)updateErrorStatus:(BOOL)hasError { 257 - (void)updateErrorStatus:(BOOL)hasError {
258 } 258 }
259 259
260 - (BaseBubbleController*)menuController { 260 - (BaseBubbleController*)menuController {
261 return menuController_; 261 return menuController_;
262 } 262 }
263 263
264 @end 264 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698