OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import "chrome/browser/autofill/autofill_dialog_controller_mac.h" | 5 #import "chrome/browser/autofill/autofill_dialog_controller_mac.h" |
6 #include "app/l10n_util.h" | 6 #include "app/l10n_util.h" |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/browser.h" |
| 11 #include "chrome/browser/browser_list.h" |
10 #import "chrome/browser/autofill/autofill_address_model_mac.h" | 12 #import "chrome/browser/autofill/autofill_address_model_mac.h" |
11 #import "chrome/browser/autofill/autofill_address_sheet_controller_mac.h" | 13 #import "chrome/browser/autofill/autofill_address_sheet_controller_mac.h" |
12 #import "chrome/browser/autofill/autofill_credit_card_model_mac.h" | 14 #import "chrome/browser/autofill/autofill_credit_card_model_mac.h" |
13 #import "chrome/browser/autofill/autofill_credit_card_sheet_controller_mac.h" | 15 #import "chrome/browser/autofill/autofill_credit_card_sheet_controller_mac.h" |
14 #import "chrome/browser/autofill/personal_data_manager.h" | 16 #import "chrome/browser/autofill/personal_data_manager.h" |
15 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
16 #import "chrome/browser/cocoa/window_size_autosaver.h" | 18 #import "chrome/browser/cocoa/window_size_autosaver.h" |
17 #include "chrome/browser/pref_service.h" | 19 #include "chrome/browser/pref_service.h" |
18 #include "chrome/browser/profile.h" | 20 #include "chrome/browser/profile.h" |
19 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 // Show the sheet. | 407 // Show the sheet. |
406 [NSApp beginSheet:[creditCardSheetController window] | 408 [NSApp beginSheet:[creditCardSheetController window] |
407 modalForWindow:[self window] | 409 modalForWindow:[self window] |
408 modalDelegate:self | 410 modalDelegate:self |
409 didEndSelector:@selector(creditCardEditDidEnd:returnCode:contextInfo:) | 411 didEndSelector:@selector(creditCardEditDidEnd:returnCode:contextInfo:) |
410 contextInfo:&creditCards_[i]]; | 412 contextInfo:&creditCards_[i]]; |
411 } | 413 } |
412 } | 414 } |
413 } | 415 } |
414 | 416 |
| 417 // Navigates to the AutoFill help url. |
| 418 - (IBAction)openHelp:(id)sender { |
| 419 Browser* browser = BrowserList::GetLastActive(); |
| 420 |
| 421 if (!browser || !browser->GetSelectedTabContents()) |
| 422 browser = Browser::Create(profile_); |
| 423 browser->OpenAutoFillHelpTabAndActivate(); |
| 424 } |
| 425 |
415 // Edit address sheet was dismissed. Non-zero |returnCode| indicates a save. | 426 // Edit address sheet was dismissed. Non-zero |returnCode| indicates a save. |
416 - (void)addressEditDidEnd:(NSWindow *)sheet | 427 - (void)addressEditDidEnd:(NSWindow *)sheet |
417 returnCode:(int)returnCode | 428 returnCode:(int)returnCode |
418 contextInfo:(void *)contextInfo { | 429 contextInfo:(void *)contextInfo { |
419 DCHECK(contextInfo != NULL); | 430 DCHECK(contextInfo != NULL); |
420 if (returnCode) { | 431 if (returnCode) { |
421 AutoFillProfile* profile = static_cast<AutoFillProfile*>(contextInfo); | 432 AutoFillProfile* profile = static_cast<AutoFillProfile*>(contextInfo); |
422 [addressSheetController copyModelToProfile:profile]; | 433 [addressSheetController copyModelToProfile:profile]; |
423 [tableView_ reloadData]; | 434 [tableView_ reloadData]; |
424 } | 435 } |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 if (!image) { | 799 if (!image) { |
789 image = rb.GetNSImageNamed(IDR_INPUT_GOOD); | 800 image = rb.GetNSImageNamed(IDR_INPUT_GOOD); |
790 DCHECK(image); | 801 DCHECK(image); |
791 return image; | 802 return image; |
792 } | 803 } |
793 | 804 |
794 return nil; | 805 return nil; |
795 } | 806 } |
796 | 807 |
797 @end | 808 @end |
OLD | NEW |