| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/login_prompt.h" | 5 #include "chrome/browser/login_prompt.h" |
| 6 #import "chrome/browser/login_prompt_mac.h" | 6 #import "chrome/browser/login_prompt_mac.h" |
| 7 | 7 |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 const std::wstring& password) { | 73 const std::wstring& password) { |
| 74 [sheet_controller_ autofillLogin:base::SysWideToNSString(username) | 74 [sheet_controller_ autofillLogin:base::SysWideToNSString(username) |
| 75 password:base::SysWideToNSString(password)]; | 75 password:base::SysWideToNSString(password)]; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // LoginHandler: | 78 // LoginHandler: |
| 79 virtual void BuildViewForPasswordManager(PasswordManager* manager, | 79 virtual void BuildViewForPasswordManager(PasswordManager* manager, |
| 80 std::wstring explanation) { | 80 std::wstring explanation) { |
| 81 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 81 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
| 82 | 82 |
| 83 // TODO(viettrungluu): Is this still necessary with thakis's queuing? Let's |
| 84 // hypothesize "no", but I need to check this.... |
| 85 #if 0 |
| 86 TabContents* requesting_contents = GetTabContentsForLogin(); |
| 87 DCHECK(requesting_contents); |
| 88 |
| 89 // If something goes wrong (e.g., there's already a tab-modal sheet up), |
| 90 // cancel the authorization. |
| 91 if (!requesting_contents || |
| 92 !requesting_contents->CanCreateConstrainedDialog()) { |
| 93 CancelAuth(); |
| 94 return; |
| 95 } |
| 96 #endif |
| 97 |
| 83 // Load nib here instead of in constructor. | 98 // Load nib here instead of in constructor. |
| 84 sheet_controller_ = [[[LoginHandlerSheet alloc] | 99 sheet_controller_ = [[[LoginHandlerSheet alloc] |
| 85 initWithLoginHandler:this] autorelease]; | 100 initWithLoginHandler:this] autorelease]; |
| 86 init([sheet_controller_ window], sheet_controller_, | 101 init([sheet_controller_ window], sheet_controller_, |
| 87 @selector(sheetDidEnd:returnCode:contextInfo:)); | 102 @selector(sheetDidEnd:returnCode:contextInfo:)); |
| 88 | 103 |
| 89 SetModel(manager); | 104 SetModel(manager); |
| 90 | 105 |
| 91 [sheet_controller_ setExplanation:base::SysWideToNSString(explanation)]; | 106 [sheet_controller_ setExplanation:base::SysWideToNSString(explanation)]; |
| 92 | 107 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 sizeToFitFixedWidthTextField:explanationField_]; | 378 sizeToFitFixedWidthTextField:explanationField_]; |
| 364 | 379 |
| 365 // Resize the window (no shifting needed due to window layout). | 380 // Resize the window (no shifting needed due to window layout). |
| 366 NSSize windowDelta = NSMakeSize(0, explanationShift); | 381 NSSize windowDelta = NSMakeSize(0, explanationShift); |
| 367 [GTMUILocalizerAndLayoutTweaker | 382 [GTMUILocalizerAndLayoutTweaker |
| 368 resizeWindowWithoutAutoResizingSubViews:[self window] | 383 resizeWindowWithoutAutoResizingSubViews:[self window] |
| 369 delta:windowDelta]; | 384 delta:windowDelta]; |
| 370 } | 385 } |
| 371 | 386 |
| 372 @end | 387 @end |
| OLD | NEW |