| 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_main_container.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_main_container.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Set up Wallet icon. | 55 // Set up Wallet icon. |
| 56 buttonStripImage_.reset([[NSImageView alloc] initWithFrame:NSZeroRect]); | 56 buttonStripImage_.reset([[NSImageView alloc] initWithFrame:NSZeroRect]); |
| 57 [self updateWalletIcon]; | 57 [self updateWalletIcon]; |
| 58 [[self view] addSubview:buttonStripImage_]; | 58 [[self view] addSubview:buttonStripImage_]; |
| 59 | 59 |
| 60 // Set up "Save in Chrome" checkbox. | 60 // Set up "Save in Chrome" checkbox. |
| 61 saveInChromeCheckbox_.reset([[NSButton alloc] initWithFrame:NSZeroRect]); | 61 saveInChromeCheckbox_.reset([[NSButton alloc] initWithFrame:NSZeroRect]); |
| 62 [saveInChromeCheckbox_ setButtonType:NSSwitchButton]; | 62 [saveInChromeCheckbox_ setButtonType:NSSwitchButton]; |
| 63 [saveInChromeCheckbox_ setTitle: | 63 [saveInChromeCheckbox_ setTitle: |
| 64 base::SysUTF16ToNSString(delegate_->SaveLocallyText())]; | 64 base::SysUTF16ToNSString(delegate_->SaveLocallyText())]; |
| 65 [self updateSaveInChrome]; | |
| 66 [saveInChromeCheckbox_ sizeToFit]; | 65 [saveInChromeCheckbox_ sizeToFit]; |
| 67 [[self view] addSubview:saveInChromeCheckbox_]; | 66 [[self view] addSubview:saveInChromeCheckbox_]; |
| 68 | 67 |
| 69 saveInChromeTooltip_.reset([[NSImageView alloc] initWithFrame:NSZeroRect]); | 68 saveInChromeTooltip_.reset([[NSImageView alloc] initWithFrame:NSZeroRect]); |
| 70 [saveInChromeTooltip_ setImage: | 69 [saveInChromeTooltip_ setImage: |
| 71 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 70 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 72 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage()]; | 71 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage()]; |
| 73 [saveInChromeTooltip_ setToolTip: | 72 [saveInChromeTooltip_ setToolTip: |
| 74 base::SysUTF16ToNSString(delegate_->SaveLocallyTooltip())]; | 73 base::SysUTF16ToNSString(delegate_->SaveLocallyTooltip())]; |
| 75 [saveInChromeTooltip_ setFrameSize:[[saveInChromeTooltip_ image] size]]; | 74 [saveInChromeTooltip_ setFrameSize:[[saveInChromeTooltip_ image] size]]; |
| 76 [[self view] addSubview:saveInChromeTooltip_]; | 75 [[self view] addSubview:saveInChromeTooltip_]; |
| 76 [self updateSaveInChrome]; |
| 77 | 77 |
| 78 detailsContainer_.reset( | 78 detailsContainer_.reset( |
| 79 [[AutofillDetailsContainer alloc] initWithDelegate:delegate_]); | 79 [[AutofillDetailsContainer alloc] initWithDelegate:delegate_]); |
| 80 NSSize frameSize = [[detailsContainer_ view] frame].size; | 80 NSSize frameSize = [[detailsContainer_ view] frame].size; |
| 81 [[detailsContainer_ view] setFrameOrigin: | 81 [[detailsContainer_ view] setFrameOrigin: |
| 82 NSMakePoint(0, NSHeight([buttonContainer_ frame]))]; | 82 NSMakePoint(0, NSHeight([buttonContainer_ frame]))]; |
| 83 frameSize.height += NSHeight([buttonContainer_ frame]); | 83 frameSize.height += NSHeight([buttonContainer_ frame]); |
| 84 [[self view] setFrameSize:frameSize]; | 84 [[self view] setFrameSize:frameSize]; |
| 85 [[self view] addSubview:[detailsContainer_ view]]; | 85 [[self view] addSubview:[detailsContainer_ view]]; |
| 86 | 86 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 - (NSImageView*)buttonStripImageForTesting { | 345 - (NSImageView*)buttonStripImageForTesting { |
| 346 return buttonStripImage_.get(); | 346 return buttonStripImage_.get(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 - (NSImageView*)saveInChromeTooltipForTesting { | 349 - (NSImageView*)saveInChromeTooltipForTesting { |
| 350 return saveInChromeTooltip_.get(); | 350 return saveInChromeTooltip_.get(); |
| 351 } | 351 } |
| 352 | 352 |
| 353 @end | 353 @end |
| OLD | NEW |