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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // Set up "Save in Chrome" checkbox. | 77 // Set up "Save in Chrome" checkbox. |
78 saveInChromeCheckbox_.reset([[NSButton alloc] initWithFrame:NSZeroRect]); | 78 saveInChromeCheckbox_.reset([[NSButton alloc] initWithFrame:NSZeroRect]); |
79 [saveInChromeCheckbox_ setButtonType:NSSwitchButton]; | 79 [saveInChromeCheckbox_ setButtonType:NSSwitchButton]; |
80 [saveInChromeCheckbox_ setTitle: | 80 [saveInChromeCheckbox_ setTitle: |
81 base::SysUTF16ToNSString(delegate_->SaveLocallyText())]; | 81 base::SysUTF16ToNSString(delegate_->SaveLocallyText())]; |
82 [saveInChromeCheckbox_ sizeToFit]; | 82 [saveInChromeCheckbox_ sizeToFit]; |
83 [[self view] addSubview:saveInChromeCheckbox_]; | 83 [[self view] addSubview:saveInChromeCheckbox_]; |
84 | 84 |
85 saveInChromeTooltip_.reset( | 85 saveInChromeTooltip_.reset( |
86 [[AutofillTooltipController alloc] | 86 [[AutofillTooltipController alloc] init]); |
87 initWithArrowLocation:info_bubble::kTopCenter]); | |
88 [saveInChromeTooltip_ setImage: | 87 [saveInChromeTooltip_ setImage: |
89 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 88 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
90 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage()]; | 89 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage()]; |
91 [saveInChromeTooltip_ setMessage: | 90 [saveInChromeTooltip_ setMessage: |
92 base::SysUTF16ToNSString(delegate_->SaveLocallyTooltip())]; | 91 base::SysUTF16ToNSString(delegate_->SaveLocallyTooltip())]; |
93 [[self view] addSubview:[saveInChromeTooltip_ view]]; | 92 [[self view] addSubview:[saveInChromeTooltip_ view]]; |
94 [self updateSaveInChrome]; | 93 [self updateSaveInChrome]; |
95 | 94 |
96 detailsContainer_.reset( | 95 detailsContainer_.reset( |
97 [[AutofillDetailsContainer alloc] initWithDelegate:delegate_]); | 96 [[AutofillDetailsContainer alloc] initWithDelegate:delegate_]); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 418 |
420 - (NSImageView*)buttonStripImageForTesting { | 419 - (NSImageView*)buttonStripImageForTesting { |
421 return buttonStripImage_.get(); | 420 return buttonStripImage_.get(); |
422 } | 421 } |
423 | 422 |
424 - (NSButton*)saveInChromeTooltipForTesting { | 423 - (NSButton*)saveInChromeTooltipForTesting { |
425 return base::mac::ObjCCast<NSButton>([saveInChromeTooltip_ view]); | 424 return base::mac::ObjCCast<NSButton>([saveInChromeTooltip_ view]); |
426 } | 425 } |
427 | 426 |
428 @end | 427 @end |
OLD | NEW |