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

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: Close the constrained window when the window controller is deallocated. Created 5 years, 4 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..90797d7d8ce0966c9eb5567a5b3f3f7e197c5d44 100644
--- a/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
+++ b/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
@@ -232,6 +232,14 @@ class ReauthDialogDelegate : public UserManager::ReauthDialogObserver,
constrained_window_->CloseWebContentsModalDialog();
}
+- (void)dealloc {
+ //auto closeButton = [[self window] standardWindowButton:NSWindowCloseButton];
+ //[closeButton setTarget:nil];
groby-ooo-7-16 2015/09/12 00:42:16 Remove commented out code
anthonyvd 2015/09/14 23:59:18 oops, missed this. Thanks!
+ constrained_window_->CloseWebContentsModalDialog();
+
+ [super dealloc];
+}
+
@end
// Window controller for the User Manager view.
@@ -290,6 +298,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 +366,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