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

Unified Diff: chrome/browser/login_prompt_mac.mm

Issue 164547: Mac: make save/open dialogs operate as tab-modal sheets.... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Painfully (but hopefully correctly) merged ToT. Created 11 years, 2 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 | « chrome/browser/gtk/dialogs_gtk.cc ('k') | chrome/browser/shell_dialogs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/login_prompt_mac.mm
diff --git a/chrome/browser/login_prompt_mac.mm b/chrome/browser/login_prompt_mac.mm
index 8a9e93c65c4c96f90cacb41d4877c236b066ba0d..c4384c2e1f7b319ce23e9a10123527b3f0fb780e 100644
--- a/chrome/browser/login_prompt_mac.mm
+++ b/chrome/browser/login_prompt_mac.mm
@@ -82,6 +82,17 @@ class LoginHandlerMac : public LoginHandler,
std::wstring explanation) {
DCHECK(MessageLoop::current() == ui_loop_);
+ TabContents* requesting_contents = GetTabContentsForLogin();
+ DCHECK(requesting_contents);
+
+ // If something goes wrong (e.g., there's already a tab-modal sheet up),
+ // cancel the authorization.
+ if (!requesting_contents ||
+ !requesting_contents->CanCreateConstrainedDialog()) {
+ CancelAuth();
+ return;
+ }
+
// Load nib here instead of in constructor.
sheet_controller_ = [[[LoginHandlerSheet alloc]
initWithLoginHandler:this] autorelease];
« no previous file with comments | « chrome/browser/gtk/dialogs_gtk.cc ('k') | chrome/browser/shell_dialogs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698