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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 63053003: Ask libaddressinput for address components to use in requestAutocomplete(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 11 months 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
OLDNEW
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 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1971 ui::ComboboxModel* input_model = 1971 ui::ComboboxModel* input_model =
1972 delegate_->ComboboxModelForAutofillType(input.type); 1972 delegate_->ComboboxModelForAutofillType(input.type);
1973 scoped_ptr<views::View> view_to_add; 1973 scoped_ptr<views::View> view_to_add;
1974 if (input_model) { 1974 if (input_model) {
1975 views::Combobox* combobox = new views::Combobox(input_model); 1975 views::Combobox* combobox = new views::Combobox(input_model);
1976 combobox->set_listener(this); 1976 combobox->set_listener(this);
1977 comboboxes->insert(std::make_pair(input.type, combobox)); 1977 comboboxes->insert(std::make_pair(input.type, combobox));
1978 SelectComboboxValueOrSetToDefault(combobox, input.initial_value); 1978 SelectComboboxValueOrSetToDefault(combobox, input.initial_value);
1979 view_to_add.reset(combobox); 1979 view_to_add.reset(combobox);
1980 } else { 1980 } else {
1981 DecoratedTextfield* field = new DecoratedTextfield( 1981 DecoratedTextfield* field = new DecoratedTextfield(input.initial_value,
1982 input.initial_value, 1982 input.placeholder_text,
1983 l10n_util::GetStringUTF16(input.placeholder_text_rid), 1983 this);
1984 this);
1985
1986 textfields->insert(std::make_pair(input.type, field)); 1984 textfields->insert(std::make_pair(input.type, field));
1987 view_to_add.reset(field); 1985 view_to_add.reset(field);
1988 } 1986 }
1989 1987
1990 if (input.length == DetailInput::NONE) { 1988 if (input.length == DetailInput::NONE) {
1991 other_owned_views_.push_back(view_to_add.release()); 1989 other_owned_views_.push_back(view_to_add.release());
1992 continue; 1990 continue;
1993 } 1991 }
1994 1992
1995 if (input.length == DetailInput::LONG) 1993 if (input.length == DetailInput::LONG)
(...skipping 22 matching lines...) Expand all
2018 0, 2016 0,
2019 0); 2017 0);
2020 2018
2021 // This is the same as AddView(view_to_add), except that 1 is used for the 2019 // This is the same as AddView(view_to_add), except that 1 is used for the
2022 // view's preferred width. Thus the width of the column completely depends 2020 // view's preferred width. Thus the width of the column completely depends
2023 // on |expand|. 2021 // on |expand|.
2024 layout->AddView(view_to_add.release(), 1, 1, 2022 layout->AddView(view_to_add.release(), 1, 1,
2025 views::GridLayout::FILL, views::GridLayout::FILL, 2023 views::GridLayout::FILL, views::GridLayout::FILL,
2026 1, 0); 2024 1, 0);
2027 2025
2028 if (input.length == DetailInput::LONG) 2026 if (input.length == DetailInput::LONG ||
2027 input.length == DetailInput::SHORT_EOL) {
2029 ++column_set_id; 2028 ++column_set_id;
2029 }
2030 } 2030 }
2031 2031
2032 SetIconsForSection(section); 2032 SetIconsForSection(section);
2033 2033
2034 return view; 2034 return view;
2035 } 2035 }
2036 2036
2037 void AutofillDialogViews::ShowDialogInMode(DialogMode dialog_mode) { 2037 void AutofillDialogViews::ShowDialogInMode(DialogMode dialog_mode) {
2038 loading_shield_->SetVisible(dialog_mode == LOADING); 2038 loading_shield_->SetVisible(dialog_mode == LOADING);
2039 sign_in_web_view_->SetVisible(dialog_mode == SIGN_IN); 2039 sign_in_web_view_->SetVisible(dialog_mode == SIGN_IN);
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
2451 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 2451 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
2452 : section(section), 2452 : section(section),
2453 container(NULL), 2453 container(NULL),
2454 manual_input(NULL), 2454 manual_input(NULL),
2455 suggested_info(NULL), 2455 suggested_info(NULL),
2456 suggested_button(NULL) {} 2456 suggested_button(NULL) {}
2457 2457
2458 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 2458 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
2459 2459
2460 } // namespace autofill 2460 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698