Commit 94eb42fb authored by groby@chromium.org's avatar groby@chromium.org

[OSX, rAC] Fix helpers to match Views behavior.

The field accessor functions for the Views test helpers only obtain
values from sections that are actually active. (By virtue of the way
the Views dialog is built). Match OSX to do the same.

NOTRY=true
BUG=none
R=estade@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251245 0039d316-1c4b-4281-b951-d872f2087c98
parent 44652d91
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
forType:(autofill::ServerFieldType)type { forType:(autofill::ServerFieldType)type {
for (size_t i = autofill::SECTION_MIN; i <= autofill::SECTION_MAX; ++i) { for (size_t i = autofill::SECTION_MIN; i <= autofill::SECTION_MAX; ++i) {
autofill::DialogSection section = static_cast<autofill::DialogSection>(i); autofill::DialogSection section = static_cast<autofill::DialogSection>(i);
if (!dialog_->delegate()->SectionIsActive(section))
continue;
// TODO(groby): Need to find the section for an input directly - wasteful. // TODO(groby): Need to find the section for an input directly - wasteful.
[[mainContainer_ sectionForId:section] setFieldValue:text forType:type]; [[mainContainer_ sectionForId:section] setFieldValue:text forType:type];
} }
...@@ -45,6 +47,8 @@ ...@@ -45,6 +47,8 @@
- (void)activateFieldForType:(autofill::ServerFieldType)type { - (void)activateFieldForType:(autofill::ServerFieldType)type {
for (size_t i = autofill::SECTION_MIN; i <= autofill::SECTION_MAX; ++i) { for (size_t i = autofill::SECTION_MIN; i <= autofill::SECTION_MAX; ++i) {
autofill::DialogSection section = static_cast<autofill::DialogSection>(i); autofill::DialogSection section = static_cast<autofill::DialogSection>(i);
if (!dialog_->delegate()->SectionIsActive(section))
continue;
[[mainContainer_ sectionForId:section] activateFieldForType:type]; [[mainContainer_ sectionForId:section] activateFieldForType:type];
} }
} }
...@@ -86,6 +90,8 @@ base::string16 AutofillDialogViewTesterCocoa::GetTextContentsOfInput( ...@@ -86,6 +90,8 @@ base::string16 AutofillDialogViewTesterCocoa::GetTextContentsOfInput(
ServerFieldType type) { ServerFieldType type) {
for (size_t i = SECTION_MIN; i <= SECTION_MAX; ++i) { for (size_t i = SECTION_MIN; i <= SECTION_MAX; ++i) {
DialogSection section = static_cast<DialogSection>(i); DialogSection section = static_cast<DialogSection>(i);
if (!dialog_->delegate()->SectionIsActive(section))
continue;
FieldValueMap contents; FieldValueMap contents;
[controller() getInputs:&contents forSection:section]; [controller() getInputs:&contents forSection:section];
FieldValueMap::const_iterator it = contents.find(type); FieldValueMap::const_iterator it = contents.find(type);
......
...@@ -651,10 +651,10 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section, ...@@ -651,10 +651,10 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section,
[field setDefaultValue:@""]; [field setDefaultValue:@""];
control.reset(field.release()); control.reset(field.release());
} }
[control setTag:input.type];
[control setFieldValue:base::SysUTF16ToNSString(input.initial_value)]; [control setFieldValue:base::SysUTF16ToNSString(input.initial_value)];
[control sizeToFit]; [control sizeToFit];
[control setFrame:NSIntegralRect([control frame])]; [control setFrame:NSIntegralRect([control frame])];
[control setTag:input.type];
[control setInputDelegate:self]; [control setInputDelegate:self];
// Hide away fields that cannot be edited. // Hide away fields that cannot be edited.
if (kColumnSetId == -1) { if (kColumnSetId == -1) {
......
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