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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 } | 459 } |
460 | 460 |
461 - (NSTextField*)makeDetailSectionLabel:(NSString*)labelText { | 461 - (NSTextField*)makeDetailSectionLabel:(NSString*)labelText { |
462 base::scoped_nsobject<NSTextField> label([[NSTextField alloc] init]); | 462 base::scoped_nsobject<NSTextField> label([[NSTextField alloc] init]); |
463 [label setFont: | 463 [label setFont: |
464 [[NSFontManager sharedFontManager] convertFont:[label font] | 464 [[NSFontManager sharedFontManager] convertFont:[label font] |
465 toHaveTrait:NSBoldFontMask]]; | 465 toHaveTrait:NSBoldFontMask]]; |
466 [label setStringValue:labelText]; | 466 [label setStringValue:labelText]; |
467 [label setEditable:NO]; | 467 [label setEditable:NO]; |
468 [label setBordered:NO]; | 468 [label setBordered:NO]; |
| 469 [label setDrawsBackground:NO]; |
469 [label sizeToFit]; | 470 [label sizeToFit]; |
470 return label.autorelease(); | 471 return label.autorelease(); |
471 } | 472 } |
472 | 473 |
473 - (void)updateAndClobber:(BOOL)shouldClobber { | 474 - (void)updateAndClobber:(BOOL)shouldClobber { |
474 const autofill::DetailInputs& updatedInputs = | 475 const autofill::DetailInputs& updatedInputs = |
475 delegate_->RequestedFieldsForSection(section_); | 476 delegate_->RequestedFieldsForSection(section_); |
476 | 477 |
477 for (autofill::DetailInputs::const_iterator iter = updatedInputs.begin(); | 478 for (autofill::DetailInputs::const_iterator iter = updatedInputs.begin(); |
478 iter != updatedInputs.end(); | 479 iter != updatedInputs.end(); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 | 622 |
622 - (void)activateFieldForInput:(const autofill::DetailInput&)input { | 623 - (void)activateFieldForInput:(const autofill::DetailInput&)input { |
623 if ([self detailInputForType:input.type] != &input) | 624 if ([self detailInputForType:input.type] != &input) |
624 return; | 625 return; |
625 | 626 |
626 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:input.type]; | 627 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:input.type]; |
627 [[field window] makeFirstResponder:field]; | 628 [[field window] makeFirstResponder:field]; |
628 } | 629 } |
629 | 630 |
630 @end | 631 @end |
OLD | NEW |