Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_main_container.mm

Issue 58913002: [rAc OSX] Ensure that the "Save in Chrome?" tooltip is only visible when the checkbox is. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/autofill/autofill_main_container_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/autofill/autofill_main_container_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698