| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ui/cocoa/autofill/autofill_section_container.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_section_container.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 NSString* tooltipText = | 668 NSString* tooltipText = |
| 669 base::SysUTF16ToNSString(delegate_->TooltipForField(input.type)); | 669 base::SysUTF16ToNSString(delegate_->TooltipForField(input.type)); |
| 670 // VoiceOver onlys seems to pick up the help message on [field cell] | 670 // VoiceOver onlys seems to pick up the help message on [field cell] |
| 671 // (rather than just field). | 671 // (rather than just field). |
| 672 BOOL success = [[field cell] | 672 BOOL success = [[field cell] |
| 673 accessibilitySetOverrideValue:tooltipText | 673 accessibilitySetOverrideValue:tooltipText |
| 674 forAttribute:NSAccessibilityHelpAttribute]; | 674 forAttribute:NSAccessibilityHelpAttribute]; |
| 675 DCHECK(success); | 675 DCHECK(success); |
| 676 if ([tooltipText length] > 0) { | 676 if ([tooltipText length] > 0) { |
| 677 if (!tooltipController_) { | 677 if (!tooltipController_) { |
| 678 tooltipController_.reset( | 678 tooltipController_.reset([[AutofillTooltipController alloc] |
| 679 [[AutofillTooltipController alloc] | 679 initWithArrowLocation:views::BubbleBorder::TOP_RIGHT]); |
| 680 initWithArrowLocation:info_bubble::kTopRight]); | |
| 681 } | 680 } |
| 682 tooltipField_ = field.get(); | 681 tooltipField_ = field.get(); |
| 683 NSImage* icon = | 682 NSImage* icon = |
| 684 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 683 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 685 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage(); | 684 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage(); |
| 686 [tooltipController_ setImage:icon]; | 685 [tooltipController_ setImage:icon]; |
| 687 [tooltipController_ setMessage:tooltipText]; | 686 [tooltipController_ setMessage:tooltipText]; |
| 688 [[field cell] setDecorationSize:[icon size]]; | 687 [[field cell] setDecorationSize:[icon size]]; |
| 689 } | 688 } |
| 690 [field setDefaultValue:@""]; | 689 [field setDefaultValue:@""]; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 | 767 |
| 769 - (void)activateFieldForType:(autofill::ServerFieldType)type { | 768 - (void)activateFieldForType:(autofill::ServerFieldType)type { |
| 770 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:type]; | 769 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:type]; |
| 771 if (field) { | 770 if (field) { |
| 772 [[field window] makeFirstResponder:field]; | 771 [[field window] makeFirstResponder:field]; |
| 773 [self fieldEditedOrActivated:field edited:NO]; | 772 [self fieldEditedOrActivated:field edited:NO]; |
| 774 } | 773 } |
| 775 } | 774 } |
| 776 | 775 |
| 777 @end | 776 @end |
| OLD | NEW |