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 @@
forType:(autofill::ServerFieldType)type {
for (size_t i = autofill::SECTION_MIN; i <= autofill::SECTION_MAX; ++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.
[[mainContainer_ sectionForId:section] setFieldValue:text forType:type];
}
......@@ -45,6 +47,8 @@
- (void)activateFieldForType:(autofill::ServerFieldType)type {
for (size_t i = autofill::SECTION_MIN; i <= autofill::SECTION_MAX; ++i) {
autofill::DialogSection section = static_cast<autofill::DialogSection>(i);
if (!dialog_->delegate()->SectionIsActive(section))
continue;
[[mainContainer_ sectionForId:section] activateFieldForType:type];
}
}
......@@ -86,6 +90,8 @@ base::string16 AutofillDialogViewTesterCocoa::GetTextContentsOfInput(
ServerFieldType type) {
for (size_t i = SECTION_MIN; i <= SECTION_MAX; ++i) {
DialogSection section = static_cast<DialogSection>(i);
if (!dialog_->delegate()->SectionIsActive(section))
continue;
FieldValueMap contents;
[controller() getInputs:&contents forSection:section];
FieldValueMap::const_iterator it = contents.find(type);
......
......@@ -651,10 +651,10 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section,
[field setDefaultValue:@""];
control.reset(field.release());
}
[control setTag:input.type];
[control setFieldValue:base::SysUTF16ToNSString(input.initial_value)];
[control sizeToFit];
[control setFrame:NSIntegralRect([control frame])];
[control setTag:input.type];
[control setInputDelegate:self];
// Hide away fields that cannot be edited.
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