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

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

Issue 22009003: [Autofill] Distinguish between native field types and potentially HTML field types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 2004 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 view->ScrollRectToVisible(view->GetLocalBounds()); 2015 view->ScrollRectToVisible(view->GetLocalBounds());
2016 error_bubble_.reset(new ErrorBubble(view, error_message->second)); 2016 error_bubble_.reset(new ErrorBubble(view, error_message->second));
2017 } 2017 }
2018 } 2018 }
2019 2019
2020 void AutofillDialogViews::MarkInputsInvalid(DialogSection section, 2020 void AutofillDialogViews::MarkInputsInvalid(DialogSection section,
2021 const ValidityData& validity_data) { 2021 const ValidityData& validity_data) {
2022 DetailsGroup* group = GroupForSection(section); 2022 DetailsGroup* group = GroupForSection(section);
2023 DCHECK(group->container->visible()); 2023 DCHECK(group->container->visible());
2024 2024
2025 typedef std::map<AutofillFieldType, 2025 typedef std::map<ServerFieldType,
2026 base::Callback<void(const base::string16&)> > FieldMap; 2026 base::Callback<void(const base::string16&)> > FieldMap;
2027 FieldMap field_map; 2027 FieldMap field_map;
2028 2028
2029 if (group->manual_input->visible()) { 2029 if (group->manual_input->visible()) {
2030 for (TextfieldMap::const_iterator iter = group->textfields.begin(); 2030 for (TextfieldMap::const_iterator iter = group->textfields.begin();
2031 iter != group->textfields.end(); ++iter) { 2031 iter != group->textfields.end(); ++iter) {
2032 field_map[iter->first->type] = base::Bind( 2032 field_map[iter->first->type] = base::Bind(
2033 &AutofillDialogViews::SetValidityForInput<DecoratedTextfield>, 2033 &AutofillDialogViews::SetValidityForInput<DecoratedTextfield>,
2034 base::Unretained(this), 2034 base::Unretained(this),
2035 iter->second); 2035 iter->second);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
2132 2132
2133 return all_valid; 2133 return all_valid;
2134 } 2134 }
2135 2135
2136 void AutofillDialogViews::TextfieldEditedOrActivated( 2136 void AutofillDialogViews::TextfieldEditedOrActivated(
2137 views::Textfield* textfield, 2137 views::Textfield* textfield,
2138 bool was_edit) { 2138 bool was_edit) {
2139 DetailsGroup* group = GroupForView(textfield); 2139 DetailsGroup* group = GroupForView(textfield);
2140 DCHECK(group); 2140 DCHECK(group);
2141 2141
2142 // Figure out the AutofillFieldType this textfield represents. 2142 // Figure out the ServerFieldType this textfield represents.
2143 AutofillFieldType type = UNKNOWN_TYPE; 2143 ServerFieldType type = UNKNOWN_TYPE;
2144 DecoratedTextfield* decorated = NULL; 2144 DecoratedTextfield* decorated = NULL;
2145 2145
2146 // Look for the input in the manual inputs. 2146 // Look for the input in the manual inputs.
2147 for (TextfieldMap::const_iterator iter = group->textfields.begin(); 2147 for (TextfieldMap::const_iterator iter = group->textfields.begin();
2148 iter != group->textfields.end(); 2148 iter != group->textfields.end();
2149 ++iter) { 2149 ++iter) {
2150 decorated = iter->second; 2150 decorated = iter->second;
2151 if (decorated == textfield) { 2151 if (decorated == textfield) {
2152 delegate_->UserEditedOrActivatedInput(group->section, 2152 delegate_->UserEditedOrActivatedInput(group->section,
2153 iter->first, 2153 iter->first,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 2271 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
2272 : section(section), 2272 : section(section),
2273 container(NULL), 2273 container(NULL),
2274 manual_input(NULL), 2274 manual_input(NULL),
2275 suggested_info(NULL), 2275 suggested_info(NULL),
2276 suggested_button(NULL) {} 2276 suggested_button(NULL) {}
2277 2277
2278 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 2278 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
2279 2279
2280 } // namespace autofill 2280 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698