Index: chrome/browser/ui/cocoa/profiles/user_manager_mac.mm |
diff --git a/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm b/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm |
index 866b2192c788e88f7ec116760c18e0023cf03006..9cd790f7b9d6de890243873c086ffe9bec6ebad5 100644 |
--- a/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm |
+++ b/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm |
@@ -232,6 +232,12 @@ class ReauthDialogDelegate : public UserManager::ReauthDialogObserver, |
constrained_window_->CloseWebContentsModalDialog(); |
} |
+- (void)dealloc { |
+ constrained_window_->CloseWebContentsModalDialog(); |
+ |
+ [super dealloc]; |
+} |
+ |
@end |
// Window controller for the User Manager view. |
@@ -290,6 +296,13 @@ class ReauthDialogDelegate : public UserManager::ReauthDialogObserver, |
webContentsDelegate_.reset(new UserManagerWebContentsDelegate()); |
webContents_->SetDelegate(webContentsDelegate_.get()); |
+ web_modal::WebContentsModalDialogManager::CreateForWebContents( |
+ webContents_.get()); |
+ modal_manager_delegate_.reset( |
+ new UserManagerModalManagerDelegate([[self window] contentView])); |
+ web_modal::WebContentsModalDialogManager::FromWebContents( |
+ webContents_.get())->SetDelegate(modal_manager_delegate_.get()); |
+ |
[[NSNotificationCenter defaultCenter] |
addObserver:self |
selector:@selector(windowWillClose:) |
@@ -351,14 +364,6 @@ class ReauthDialogDelegate : public UserManager::ReauthDialogObserver, |
} |
- (void)showReauthDialogWithProfile:(Profile*)profile email:(std::string)email { |
- // Make sure there's a WebContentsModalDialogManager for this UserManager's |
- // web contents. |
- web_modal::WebContentsModalDialogManager::CreateForWebContents( |
- webContents_.get()); |
- modal_manager_delegate_.reset( |
- new UserManagerModalManagerDelegate([[self window] contentView])); |
- web_modal::WebContentsModalDialogManager::FromWebContents( |
- webContents_.get())->SetDelegate(modal_manager_delegate_.get()); |
reauth_window_controller_.reset( |
[[ReauthDialogWindowController alloc] |
initWithProfile:profile |