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

Unified Diff: chrome/browser/ui/cocoa/profiles/user_manager_mac.mm

Issue 1320893003: Create the UserManager's Dialog Manager during init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove commented code. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698