Commit 51bcdafd authored by groby@chromium.org's avatar groby@chromium.org

[rAC, OSX] saveInChrome status now persistent.

The AutofillDialogController already persisted the state of the
"Save in Chrome" checkbox. This CL ensures that the OSX dialog reflects
that persisted state and is properly updated when the state changes.

NOTRY=true
BUG=282101
R=avi@chromium.org

Review URL: https://codereview.chromium.org/25405003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226376 0039d316-1c4b-4281-b951-d872f2087c98
parent 9f55ec3a
...@@ -500,11 +500,13 @@ void AutofillDialogCocoa::OnConstrainedWindowClosed( ...@@ -500,11 +500,13 @@ void AutofillDialogCocoa::OnConstrainedWindowClosed(
- (void)updateSection:(autofill::DialogSection)section { - (void)updateSection:(autofill::DialogSection)section {
[[mainContainer_ sectionForId:section] update]; [[mainContainer_ sectionForId:section] update];
[mainContainer_ updateSaveInChrome];
} }
- (void)fillSection:(autofill::DialogSection)section - (void)fillSection:(autofill::DialogSection)section
forInput:(const autofill::DetailInput&)input { forInput:(const autofill::DetailInput&)input {
[[mainContainer_ sectionForId:section] fillForInput:input]; [[mainContainer_ sectionForId:section] fillForInput:input];
[mainContainer_ updateSaveInChrome];
} }
- (content::NavigationController*)showSignIn { - (content::NavigationController*)showSignIn {
......
...@@ -71,6 +71,9 @@ namespace autofill { ...@@ -71,6 +71,9 @@ namespace autofill {
// Validates form input data. // Validates form input data.
- (BOOL)validate; - (BOOL)validate;
// Updates status of "save in Chrome" checkbox.
- (void)updateSaveInChrome;
@end @end
......
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
[saveInChromeCheckbox_ setButtonType:NSSwitchButton]; [saveInChromeCheckbox_ setButtonType:NSSwitchButton];
[saveInChromeCheckbox_ setTitle: [saveInChromeCheckbox_ setTitle:
base::SysUTF16ToNSString(delegate_->SaveLocallyText())]; base::SysUTF16ToNSString(delegate_->SaveLocallyText())];
[saveInChromeCheckbox_ setState:NSOnState]; [saveInChromeCheckbox_ setState:
(delegate_->ShouldSaveInChrome() ? NSOnState : NSOffState)];
[saveInChromeCheckbox_ sizeToFit]; [saveInChromeCheckbox_ sizeToFit];
[[self view] addSubview:saveInChromeCheckbox_]; [[self view] addSubview:saveInChromeCheckbox_];
...@@ -231,7 +232,7 @@ ...@@ -231,7 +232,7 @@
} }
- (void)modelChanged { - (void)modelChanged {
[saveInChromeCheckbox_ setHidden:!delegate_->ShouldOfferToSaveInChrome()]; [self updateSaveInChrome];
[detailsContainer_ modelChanged]; [detailsContainer_ modelChanged];
} }
...@@ -281,6 +282,10 @@ ...@@ -281,6 +282,10 @@
return [detailsContainer_ validate]; return [detailsContainer_ validate];
} }
- (void)updateSaveInChrome {
[saveInChromeCheckbox_ setHidden:!delegate_->ShouldOfferToSaveInChrome()];
}
@end @end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment