Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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)browserWillBeDestroyed { | |
|
tapted
2015/07/06 07:26:18
after dealloc
jackhou1
2015/07/07 03:27:27
Done.
| |
| 134 browser_ = nullptr; | |
| 135 } | |
| 136 | |
| 133 - (void)dealloc { | 137 - (void)dealloc { |
| 134 [[NSNotificationCenter defaultCenter] | 138 [[NSNotificationCenter defaultCenter] |
| 135 removeObserver:self | 139 removeObserver:self |
| 136 name:NSWindowWillCloseNotification | 140 name:NSWindowWillCloseNotification |
| 137 object:[menuController_ window]]; | 141 object:[menuController_ window]]; |
| 138 [super dealloc]; | 142 [super dealloc]; |
| 139 } | 143 } |
| 140 | 144 |
| 141 - (NSButton*)buttonView { | 145 - (NSButton*)buttonView { |
| 142 CHECK(button_.get()); // Subclasses must set this. | 146 CHECK(button_.get()); // Subclasses must set this. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 } | 259 } |
| 256 | 260 |
| 257 - (void)updateErrorStatus:(BOOL)hasError { | 261 - (void)updateErrorStatus:(BOOL)hasError { |
| 258 } | 262 } |
| 259 | 263 |
| 260 - (BaseBubbleController*)menuController { | 264 - (BaseBubbleController*)menuController { |
| 261 return menuController_; | 265 return menuController_; |
| 262 } | 266 } |
| 263 | 267 |
| 264 @end | 268 @end |
| OLD | NEW |