| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 ui::ComboboxModel* input_model = | 1974 ui::ComboboxModel* input_model = |
| 1975 delegate_->ComboboxModelForAutofillType(input.type); | 1975 delegate_->ComboboxModelForAutofillType(input.type); |
| 1976 scoped_ptr<views::View> view_to_add; | 1976 scoped_ptr<views::View> view_to_add; |
| 1977 if (input_model) { | 1977 if (input_model) { |
| 1978 views::Combobox* combobox = new views::Combobox(input_model); | 1978 views::Combobox* combobox = new views::Combobox(input_model); |
| 1979 combobox->set_listener(this); | 1979 combobox->set_listener(this); |
| 1980 comboboxes->insert(std::make_pair(input.type, combobox)); | 1980 comboboxes->insert(std::make_pair(input.type, combobox)); |
| 1981 SelectComboboxValueOrSetToDefault(combobox, input.initial_value); | 1981 SelectComboboxValueOrSetToDefault(combobox, input.initial_value); |
| 1982 view_to_add.reset(combobox); | 1982 view_to_add.reset(combobox); |
| 1983 } else { | 1983 } else { |
| 1984 DecoratedTextfield* field = new DecoratedTextfield( | 1984 DecoratedTextfield* field = new DecoratedTextfield(input.initial_value, |
| 1985 input.initial_value, | 1985 input.placeholder_text, |
| 1986 l10n_util::GetStringUTF16(input.placeholder_text_rid), | 1986 this); |
| 1987 this); | |
| 1988 | |
| 1989 textfields->insert(std::make_pair(input.type, field)); | 1987 textfields->insert(std::make_pair(input.type, field)); |
| 1990 view_to_add.reset(field); | 1988 view_to_add.reset(field); |
| 1991 } | 1989 } |
| 1992 | 1990 |
| 1993 if (input.length == DetailInput::NONE) { | 1991 if (input.length == DetailInput::NONE) { |
| 1994 other_owned_views_.push_back(view_to_add.release()); | 1992 other_owned_views_.push_back(view_to_add.release()); |
| 1995 continue; | 1993 continue; |
| 1996 } | 1994 } |
| 1997 | 1995 |
| 1998 if (input.length == DetailInput::LONG) | 1996 if (input.length == DetailInput::LONG) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 2021 0, | 2019 0, |
| 2022 0); | 2020 0); |
| 2023 | 2021 |
| 2024 // This is the same as AddView(view_to_add), except that 1 is used for the | 2022 // This is the same as AddView(view_to_add), except that 1 is used for the |
| 2025 // view's preferred width. Thus the width of the column completely depends | 2023 // view's preferred width. Thus the width of the column completely depends |
| 2026 // on |expand|. | 2024 // on |expand|. |
| 2027 layout->AddView(view_to_add.release(), 1, 1, | 2025 layout->AddView(view_to_add.release(), 1, 1, |
| 2028 views::GridLayout::FILL, views::GridLayout::FILL, | 2026 views::GridLayout::FILL, views::GridLayout::FILL, |
| 2029 1, 0); | 2027 1, 0); |
| 2030 | 2028 |
| 2031 if (input.length == DetailInput::LONG) | 2029 if (input.length == DetailInput::LONG || |
| 2030 input.length == DetailInput::SHORT_EOL) { |
| 2032 ++column_set_id; | 2031 ++column_set_id; |
| 2032 } |
| 2033 } | 2033 } |
| 2034 | 2034 |
| 2035 SetIconsForSection(section); | 2035 SetIconsForSection(section); |
| 2036 | 2036 |
| 2037 return view; | 2037 return view; |
| 2038 } | 2038 } |
| 2039 | 2039 |
| 2040 void AutofillDialogViews::ShowDialogInMode(DialogMode dialog_mode) { | 2040 void AutofillDialogViews::ShowDialogInMode(DialogMode dialog_mode) { |
| 2041 loading_shield_->SetVisible(dialog_mode == LOADING); | 2041 loading_shield_->SetVisible(dialog_mode == LOADING); |
| 2042 sign_in_web_view_->SetVisible(dialog_mode == SIGN_IN); | 2042 sign_in_web_view_->SetVisible(dialog_mode == SIGN_IN); |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2454 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 2454 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
| 2455 : section(section), | 2455 : section(section), |
| 2456 container(NULL), | 2456 container(NULL), |
| 2457 manual_input(NULL), | 2457 manual_input(NULL), |
| 2458 suggested_info(NULL), | 2458 suggested_info(NULL), |
| 2459 suggested_button(NULL) {} | 2459 suggested_button(NULL) {} |
| 2460 | 2460 |
| 2461 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 2461 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
| 2462 | 2462 |
| 2463 } // namespace autofill | 2463 } // namespace autofill |
| OLD | NEW |